
bin/kernel：     文件格式 elf32-i386


Disassembly of section .text:

c0100000 <kern_entry>:

.text
.globl kern_entry
kern_entry:
    # load pa of boot pgdir
    movl $REALLOC(__boot_pgdir), %eax
c0100000:	b8 00 40 12 00       	mov    $0x124000,%eax
    movl %eax, %cr3
c0100005:	0f 22 d8             	mov    %eax,%cr3

    # enable paging
    movl %cr0, %eax
c0100008:	0f 20 c0             	mov    %cr0,%eax
    orl $(CR0_PE | CR0_PG | CR0_AM | CR0_WP | CR0_NE | CR0_TS | CR0_EM | CR0_MP), %eax
c010000b:	0d 2f 00 05 80       	or     $0x8005002f,%eax
    andl $~(CR0_TS | CR0_EM), %eax
c0100010:	83 e0 f3             	and    $0xfffffff3,%eax
    movl %eax, %cr0
c0100013:	0f 22 c0             	mov    %eax,%cr0

    # update eip
    # now, eip = 0x1.....
    leal next, %eax
c0100016:	8d 05 1e 00 10 c0    	lea    0xc010001e,%eax
    # set eip = KERNBASE + 0x1.....
    jmp *%eax
c010001c:	ff e0                	jmp    *%eax

c010001e <next>:
next:

    # unmap va 0 ~ 4M, it's temporary mapping
    xorl %eax, %eax
c010001e:	31 c0                	xor    %eax,%eax
    movl %eax, __boot_pgdir
c0100020:	a3 00 40 12 c0       	mov    %eax,0xc0124000

    # set ebp, esp
    movl $0x0, %ebp
c0100025:	bd 00 00 00 00       	mov    $0x0,%ebp
    # the kernel stack region is from bootstack -- bootstacktop,
    # the kernel stack size is KSTACKSIZE (8KB)defined in memlayout.h
    movl $bootstacktop, %esp
c010002a:	bc 00 30 12 c0       	mov    $0xc0123000,%esp
    # now kernel stack is ready , call the first C function
    call kern_init
c010002f:	e8 02 00 00 00       	call   c0100036 <kern_init>

c0100034 <spin>:

# should never get here
spin:
    jmp spin
c0100034:	eb fe                	jmp    c0100034 <spin>

c0100036 <kern_init>:
int kern_init(void) __attribute__((noreturn));
void grade_backtrace(void);
static void lab1_switch_test(void);

int
kern_init(void) {
c0100036:	f3 0f 1e fb          	endbr32 
c010003a:	55                   	push   %ebp
c010003b:	89 e5                	mov    %esp,%ebp
c010003d:	83 ec 28             	sub    $0x28,%esp
    extern char edata[], end[];
    memset(edata, 0, end - edata);
c0100040:	b8 d0 da 2a c0       	mov    $0xc02adad0,%eax
c0100045:	2d 00 60 12 c0       	sub    $0xc0126000,%eax
c010004a:	89 44 24 08          	mov    %eax,0x8(%esp)
c010004e:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0100055:	00 
c0100056:	c7 04 24 00 60 12 c0 	movl   $0xc0126000,(%esp)
c010005d:	e8 7c 8c 00 00       	call   c0108cde <memset>

    cons_init();                // init the console
c0100062:	e8 56 16 00 00       	call   c01016bd <cons_init>

    const char *message = "(THU.CST) os is loading ...";
c0100067:	c7 45 f4 20 95 10 c0 	movl   $0xc0109520,-0xc(%ebp)
    cprintf("%s\n\n", message);
c010006e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100071:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100075:	c7 04 24 3c 95 10 c0 	movl   $0xc010953c,(%esp)
c010007c:	e8 34 02 00 00       	call   c01002b5 <cprintf>

    print_kerninfo();
c0100081:	e8 f2 08 00 00       	call   c0100978 <print_kerninfo>

    //grade_backtrace();

    pmm_init();                 // init physical memory management
c0100086:	e8 22 43 00 00       	call   c01043ad <pmm_init>

    pic_init();                 // init interrupt controller
c010008b:	e8 a8 17 00 00       	call   c0101838 <pic_init>
    idt_init();                 // init interrupt descriptor table
c0100090:	e8 28 19 00 00       	call   c01019bd <idt_init>

    clock_init();               // init clock interrupt
c0100095:	e8 6a 0d 00 00       	call   c0100e04 <clock_init>
    intr_enable();              // enable irq interrupt
c010009a:	e8 e5 18 00 00       	call   c0101984 <intr_enable>
    //LAB1: CAHLLENGE 1 If you try to do it, uncomment lab1_switch_test()
    // user/kernel mode switch test
    //lab1_switch_test();

    /* do nothing */
    while (1);
c010009f:	eb fe                	jmp    c010009f <kern_init+0x69>

c01000a1 <grade_backtrace2>:
}

void __attribute__((noinline))
grade_backtrace2(int arg0, int arg1, int arg2, int arg3) {
c01000a1:	f3 0f 1e fb          	endbr32 
c01000a5:	55                   	push   %ebp
c01000a6:	89 e5                	mov    %esp,%ebp
c01000a8:	83 ec 18             	sub    $0x18,%esp
    mon_backtrace(0, NULL, NULL);
c01000ab:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01000b2:	00 
c01000b3:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01000ba:	00 
c01000bb:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c01000c2:	e8 27 0d 00 00       	call   c0100dee <mon_backtrace>
}
c01000c7:	90                   	nop
c01000c8:	c9                   	leave  
c01000c9:	c3                   	ret    

c01000ca <grade_backtrace1>:

void __attribute__((noinline))
grade_backtrace1(int arg0, int arg1) {
c01000ca:	f3 0f 1e fb          	endbr32 
c01000ce:	55                   	push   %ebp
c01000cf:	89 e5                	mov    %esp,%ebp
c01000d1:	53                   	push   %ebx
c01000d2:	83 ec 14             	sub    $0x14,%esp
    grade_backtrace2(arg0, (int)&arg0, arg1, (int)&arg1);
c01000d5:	8d 4d 0c             	lea    0xc(%ebp),%ecx
c01000d8:	8b 55 0c             	mov    0xc(%ebp),%edx
c01000db:	8d 5d 08             	lea    0x8(%ebp),%ebx
c01000de:	8b 45 08             	mov    0x8(%ebp),%eax
c01000e1:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c01000e5:	89 54 24 08          	mov    %edx,0x8(%esp)
c01000e9:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c01000ed:	89 04 24             	mov    %eax,(%esp)
c01000f0:	e8 ac ff ff ff       	call   c01000a1 <grade_backtrace2>
}
c01000f5:	90                   	nop
c01000f6:	83 c4 14             	add    $0x14,%esp
c01000f9:	5b                   	pop    %ebx
c01000fa:	5d                   	pop    %ebp
c01000fb:	c3                   	ret    

c01000fc <grade_backtrace0>:

void __attribute__((noinline))
grade_backtrace0(int arg0, int arg1, int arg2) {
c01000fc:	f3 0f 1e fb          	endbr32 
c0100100:	55                   	push   %ebp
c0100101:	89 e5                	mov    %esp,%ebp
c0100103:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace1(arg0, arg2);
c0100106:	8b 45 10             	mov    0x10(%ebp),%eax
c0100109:	89 44 24 04          	mov    %eax,0x4(%esp)
c010010d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100110:	89 04 24             	mov    %eax,(%esp)
c0100113:	e8 b2 ff ff ff       	call   c01000ca <grade_backtrace1>
}
c0100118:	90                   	nop
c0100119:	c9                   	leave  
c010011a:	c3                   	ret    

c010011b <grade_backtrace>:

void
grade_backtrace(void) {
c010011b:	f3 0f 1e fb          	endbr32 
c010011f:	55                   	push   %ebp
c0100120:	89 e5                	mov    %esp,%ebp
c0100122:	83 ec 18             	sub    $0x18,%esp
    grade_backtrace0(0, (int)kern_init, 0xffff0000);
c0100125:	b8 36 00 10 c0       	mov    $0xc0100036,%eax
c010012a:	c7 44 24 08 00 00 ff 	movl   $0xffff0000,0x8(%esp)
c0100131:	ff 
c0100132:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100136:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c010013d:	e8 ba ff ff ff       	call   c01000fc <grade_backtrace0>
}
c0100142:	90                   	nop
c0100143:	c9                   	leave  
c0100144:	c3                   	ret    

c0100145 <lab1_print_cur_status>:

static void
lab1_print_cur_status(void) {
c0100145:	f3 0f 1e fb          	endbr32 
c0100149:	55                   	push   %ebp
c010014a:	89 e5                	mov    %esp,%ebp
c010014c:	83 ec 28             	sub    $0x28,%esp
    static int round = 0;
    uint16_t reg1, reg2, reg3, reg4;
    asm volatile (
c010014f:	8c 4d f6             	mov    %cs,-0xa(%ebp)
c0100152:	8c 5d f4             	mov    %ds,-0xc(%ebp)
c0100155:	8c 45 f2             	mov    %es,-0xe(%ebp)
c0100158:	8c 55 f0             	mov    %ss,-0x10(%ebp)
            "mov %%cs, %0;"
            "mov %%ds, %1;"
            "mov %%es, %2;"
            "mov %%ss, %3;"
            : "=m"(reg1), "=m"(reg2), "=m"(reg3), "=m"(reg4));
    cprintf("%d: @ring %d\n", round, reg1 & 3);
c010015b:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c010015f:	83 e0 03             	and    $0x3,%eax
c0100162:	89 c2                	mov    %eax,%edx
c0100164:	a1 00 60 12 c0       	mov    0xc0126000,%eax
c0100169:	89 54 24 08          	mov    %edx,0x8(%esp)
c010016d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100171:	c7 04 24 41 95 10 c0 	movl   $0xc0109541,(%esp)
c0100178:	e8 38 01 00 00       	call   c01002b5 <cprintf>
    cprintf("%d:  cs = %x\n", round, reg1);
c010017d:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100181:	89 c2                	mov    %eax,%edx
c0100183:	a1 00 60 12 c0       	mov    0xc0126000,%eax
c0100188:	89 54 24 08          	mov    %edx,0x8(%esp)
c010018c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100190:	c7 04 24 4f 95 10 c0 	movl   $0xc010954f,(%esp)
c0100197:	e8 19 01 00 00       	call   c01002b5 <cprintf>
    cprintf("%d:  ds = %x\n", round, reg2);
c010019c:	0f b7 45 f4          	movzwl -0xc(%ebp),%eax
c01001a0:	89 c2                	mov    %eax,%edx
c01001a2:	a1 00 60 12 c0       	mov    0xc0126000,%eax
c01001a7:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001ab:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001af:	c7 04 24 5d 95 10 c0 	movl   $0xc010955d,(%esp)
c01001b6:	e8 fa 00 00 00       	call   c01002b5 <cprintf>
    cprintf("%d:  es = %x\n", round, reg3);
c01001bb:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01001bf:	89 c2                	mov    %eax,%edx
c01001c1:	a1 00 60 12 c0       	mov    0xc0126000,%eax
c01001c6:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001ca:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001ce:	c7 04 24 6b 95 10 c0 	movl   $0xc010956b,(%esp)
c01001d5:	e8 db 00 00 00       	call   c01002b5 <cprintf>
    cprintf("%d:  ss = %x\n", round, reg4);
c01001da:	0f b7 45 f0          	movzwl -0x10(%ebp),%eax
c01001de:	89 c2                	mov    %eax,%edx
c01001e0:	a1 00 60 12 c0       	mov    0xc0126000,%eax
c01001e5:	89 54 24 08          	mov    %edx,0x8(%esp)
c01001e9:	89 44 24 04          	mov    %eax,0x4(%esp)
c01001ed:	c7 04 24 79 95 10 c0 	movl   $0xc0109579,(%esp)
c01001f4:	e8 bc 00 00 00       	call   c01002b5 <cprintf>
    round ++;
c01001f9:	a1 00 60 12 c0       	mov    0xc0126000,%eax
c01001fe:	40                   	inc    %eax
c01001ff:	a3 00 60 12 c0       	mov    %eax,0xc0126000
}
c0100204:	90                   	nop
c0100205:	c9                   	leave  
c0100206:	c3                   	ret    

c0100207 <lab1_switch_to_user>:

static void
lab1_switch_to_user(void) {
c0100207:	f3 0f 1e fb          	endbr32 
c010020b:	55                   	push   %ebp
c010020c:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 : TODO
}
c010020e:	90                   	nop
c010020f:	5d                   	pop    %ebp
c0100210:	c3                   	ret    

c0100211 <lab1_switch_to_kernel>:

static void
lab1_switch_to_kernel(void) {
c0100211:	f3 0f 1e fb          	endbr32 
c0100215:	55                   	push   %ebp
c0100216:	89 e5                	mov    %esp,%ebp
    //LAB1 CHALLENGE 1 :  TODO
}
c0100218:	90                   	nop
c0100219:	5d                   	pop    %ebp
c010021a:	c3                   	ret    

c010021b <lab1_switch_test>:

static void
lab1_switch_test(void) {
c010021b:	f3 0f 1e fb          	endbr32 
c010021f:	55                   	push   %ebp
c0100220:	89 e5                	mov    %esp,%ebp
c0100222:	83 ec 18             	sub    $0x18,%esp
    lab1_print_cur_status();
c0100225:	e8 1b ff ff ff       	call   c0100145 <lab1_print_cur_status>
    cprintf("+++ switch to  user  mode +++\n");
c010022a:	c7 04 24 88 95 10 c0 	movl   $0xc0109588,(%esp)
c0100231:	e8 7f 00 00 00       	call   c01002b5 <cprintf>
    lab1_switch_to_user();
c0100236:	e8 cc ff ff ff       	call   c0100207 <lab1_switch_to_user>
    lab1_print_cur_status();
c010023b:	e8 05 ff ff ff       	call   c0100145 <lab1_print_cur_status>
    cprintf("+++ switch to kernel mode +++\n");
c0100240:	c7 04 24 a8 95 10 c0 	movl   $0xc01095a8,(%esp)
c0100247:	e8 69 00 00 00       	call   c01002b5 <cprintf>
    lab1_switch_to_kernel();
c010024c:	e8 c0 ff ff ff       	call   c0100211 <lab1_switch_to_kernel>
    lab1_print_cur_status();
c0100251:	e8 ef fe ff ff       	call   c0100145 <lab1_print_cur_status>
}
c0100256:	90                   	nop
c0100257:	c9                   	leave  
c0100258:	c3                   	ret    

c0100259 <cputch>:
/* *
 * cputch - writes a single character @c to stdout, and it will
 * increace the value of counter pointed by @cnt.
 * */
static void
cputch(int c, int *cnt) {
c0100259:	f3 0f 1e fb          	endbr32 
c010025d:	55                   	push   %ebp
c010025e:	89 e5                	mov    %esp,%ebp
c0100260:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
c0100263:	8b 45 08             	mov    0x8(%ebp),%eax
c0100266:	89 04 24             	mov    %eax,(%esp)
c0100269:	e8 80 14 00 00       	call   c01016ee <cons_putc>
    (*cnt) ++;
c010026e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100271:	8b 00                	mov    (%eax),%eax
c0100273:	8d 50 01             	lea    0x1(%eax),%edx
c0100276:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100279:	89 10                	mov    %edx,(%eax)
}
c010027b:	90                   	nop
c010027c:	c9                   	leave  
c010027d:	c3                   	ret    

c010027e <vcprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want cprintf() instead.
 * */
int
vcprintf(const char *fmt, va_list ap) {
c010027e:	f3 0f 1e fb          	endbr32 
c0100282:	55                   	push   %ebp
c0100283:	89 e5                	mov    %esp,%ebp
c0100285:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
c0100288:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    vprintfmt((void*)cputch, &cnt, fmt, ap);
c010028f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100292:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0100296:	8b 45 08             	mov    0x8(%ebp),%eax
c0100299:	89 44 24 08          	mov    %eax,0x8(%esp)
c010029d:	8d 45 f4             	lea    -0xc(%ebp),%eax
c01002a0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01002a4:	c7 04 24 59 02 10 c0 	movl   $0xc0100259,(%esp)
c01002ab:	e8 9a 8d 00 00       	call   c010904a <vprintfmt>
    return cnt;
c01002b0:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01002b3:	c9                   	leave  
c01002b4:	c3                   	ret    

c01002b5 <cprintf>:
 *
 * The return value is the number of characters which would be
 * written to stdout.
 * */
int
cprintf(const char *fmt, ...) {
c01002b5:	f3 0f 1e fb          	endbr32 
c01002b9:	55                   	push   %ebp
c01002ba:	89 e5                	mov    %esp,%ebp
c01002bc:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c01002bf:	8d 45 0c             	lea    0xc(%ebp),%eax
c01002c2:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vcprintf(fmt, ap);
c01002c5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01002c8:	89 44 24 04          	mov    %eax,0x4(%esp)
c01002cc:	8b 45 08             	mov    0x8(%ebp),%eax
c01002cf:	89 04 24             	mov    %eax,(%esp)
c01002d2:	e8 a7 ff ff ff       	call   c010027e <vcprintf>
c01002d7:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c01002da:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01002dd:	c9                   	leave  
c01002de:	c3                   	ret    

c01002df <cputchar>:

/* cputchar - writes a single character to stdout */
void
cputchar(int c) {
c01002df:	f3 0f 1e fb          	endbr32 
c01002e3:	55                   	push   %ebp
c01002e4:	89 e5                	mov    %esp,%ebp
c01002e6:	83 ec 18             	sub    $0x18,%esp
    cons_putc(c);
c01002e9:	8b 45 08             	mov    0x8(%ebp),%eax
c01002ec:	89 04 24             	mov    %eax,(%esp)
c01002ef:	e8 fa 13 00 00       	call   c01016ee <cons_putc>
}
c01002f4:	90                   	nop
c01002f5:	c9                   	leave  
c01002f6:	c3                   	ret    

c01002f7 <cputs>:
/* *
 * cputs- writes the string pointed by @str to stdout and
 * appends a newline character.
 * */
int
cputs(const char *str) {
c01002f7:	f3 0f 1e fb          	endbr32 
c01002fb:	55                   	push   %ebp
c01002fc:	89 e5                	mov    %esp,%ebp
c01002fe:	83 ec 28             	sub    $0x28,%esp
    int cnt = 0;
c0100301:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    char c;
    while ((c = *str ++) != '\0') {
c0100308:	eb 13                	jmp    c010031d <cputs+0x26>
        cputch(c, &cnt);
c010030a:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c010030e:	8d 55 f0             	lea    -0x10(%ebp),%edx
c0100311:	89 54 24 04          	mov    %edx,0x4(%esp)
c0100315:	89 04 24             	mov    %eax,(%esp)
c0100318:	e8 3c ff ff ff       	call   c0100259 <cputch>
    while ((c = *str ++) != '\0') {
c010031d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100320:	8d 50 01             	lea    0x1(%eax),%edx
c0100323:	89 55 08             	mov    %edx,0x8(%ebp)
c0100326:	0f b6 00             	movzbl (%eax),%eax
c0100329:	88 45 f7             	mov    %al,-0x9(%ebp)
c010032c:	80 7d f7 00          	cmpb   $0x0,-0x9(%ebp)
c0100330:	75 d8                	jne    c010030a <cputs+0x13>
    }
    cputch('\n', &cnt);
c0100332:	8d 45 f0             	lea    -0x10(%ebp),%eax
c0100335:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100339:	c7 04 24 0a 00 00 00 	movl   $0xa,(%esp)
c0100340:	e8 14 ff ff ff       	call   c0100259 <cputch>
    return cnt;
c0100345:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0100348:	c9                   	leave  
c0100349:	c3                   	ret    

c010034a <getchar>:

/* getchar - reads a single non-zero character from stdin */
int
getchar(void) {
c010034a:	f3 0f 1e fb          	endbr32 
c010034e:	55                   	push   %ebp
c010034f:	89 e5                	mov    %esp,%ebp
c0100351:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = cons_getc()) == 0)
c0100354:	90                   	nop
c0100355:	e8 d5 13 00 00       	call   c010172f <cons_getc>
c010035a:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010035d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100361:	74 f2                	je     c0100355 <getchar+0xb>
        /* do nothing */;
    return c;
c0100363:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100366:	c9                   	leave  
c0100367:	c3                   	ret    

c0100368 <readline>:
 * The readline() function returns the text of the line read. If some errors
 * are happened, NULL is returned. The return value is a global variable,
 * thus it should be copied before it is used.
 * */
char *
readline(const char *prompt) {
c0100368:	f3 0f 1e fb          	endbr32 
c010036c:	55                   	push   %ebp
c010036d:	89 e5                	mov    %esp,%ebp
c010036f:	83 ec 28             	sub    $0x28,%esp
    if (prompt != NULL) {
c0100372:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100376:	74 13                	je     c010038b <readline+0x23>
        cprintf("%s", prompt);
c0100378:	8b 45 08             	mov    0x8(%ebp),%eax
c010037b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010037f:	c7 04 24 c7 95 10 c0 	movl   $0xc01095c7,(%esp)
c0100386:	e8 2a ff ff ff       	call   c01002b5 <cprintf>
    }
    int i = 0, c;
c010038b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        c = getchar();
c0100392:	e8 b3 ff ff ff       	call   c010034a <getchar>
c0100397:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (c < 0) {
c010039a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010039e:	79 07                	jns    c01003a7 <readline+0x3f>
            return NULL;
c01003a0:	b8 00 00 00 00       	mov    $0x0,%eax
c01003a5:	eb 78                	jmp    c010041f <readline+0xb7>
        }
        else if (c >= ' ' && i < BUFSIZE - 1) {
c01003a7:	83 7d f0 1f          	cmpl   $0x1f,-0x10(%ebp)
c01003ab:	7e 28                	jle    c01003d5 <readline+0x6d>
c01003ad:	81 7d f4 fe 03 00 00 	cmpl   $0x3fe,-0xc(%ebp)
c01003b4:	7f 1f                	jg     c01003d5 <readline+0x6d>
            cputchar(c);
c01003b6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01003b9:	89 04 24             	mov    %eax,(%esp)
c01003bc:	e8 1e ff ff ff       	call   c01002df <cputchar>
            buf[i ++] = c;
c01003c1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01003c4:	8d 50 01             	lea    0x1(%eax),%edx
c01003c7:	89 55 f4             	mov    %edx,-0xc(%ebp)
c01003ca:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01003cd:	88 90 20 60 12 c0    	mov    %dl,-0x3fed9fe0(%eax)
c01003d3:	eb 45                	jmp    c010041a <readline+0xb2>
        }
        else if (c == '\b' && i > 0) {
c01003d5:	83 7d f0 08          	cmpl   $0x8,-0x10(%ebp)
c01003d9:	75 16                	jne    c01003f1 <readline+0x89>
c01003db:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01003df:	7e 10                	jle    c01003f1 <readline+0x89>
            cputchar(c);
c01003e1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01003e4:	89 04 24             	mov    %eax,(%esp)
c01003e7:	e8 f3 fe ff ff       	call   c01002df <cputchar>
            i --;
c01003ec:	ff 4d f4             	decl   -0xc(%ebp)
c01003ef:	eb 29                	jmp    c010041a <readline+0xb2>
        }
        else if (c == '\n' || c == '\r') {
c01003f1:	83 7d f0 0a          	cmpl   $0xa,-0x10(%ebp)
c01003f5:	74 06                	je     c01003fd <readline+0x95>
c01003f7:	83 7d f0 0d          	cmpl   $0xd,-0x10(%ebp)
c01003fb:	75 95                	jne    c0100392 <readline+0x2a>
            cputchar(c);
c01003fd:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100400:	89 04 24             	mov    %eax,(%esp)
c0100403:	e8 d7 fe ff ff       	call   c01002df <cputchar>
            buf[i] = '\0';
c0100408:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010040b:	05 20 60 12 c0       	add    $0xc0126020,%eax
c0100410:	c6 00 00             	movb   $0x0,(%eax)
            return buf;
c0100413:	b8 20 60 12 c0       	mov    $0xc0126020,%eax
c0100418:	eb 05                	jmp    c010041f <readline+0xb7>
        c = getchar();
c010041a:	e9 73 ff ff ff       	jmp    c0100392 <readline+0x2a>
        }
    }
}
c010041f:	c9                   	leave  
c0100420:	c3                   	ret    

c0100421 <__panic>:
/* *
 * __panic - __panic is called on unresolvable fatal errors. it prints
 * "panic: 'message'", and then enters the kernel monitor.
 * */
void
__panic(const char *file, int line, const char *fmt, ...) {
c0100421:	f3 0f 1e fb          	endbr32 
c0100425:	55                   	push   %ebp
c0100426:	89 e5                	mov    %esp,%ebp
c0100428:	83 ec 28             	sub    $0x28,%esp
    if (is_panic) {
c010042b:	a1 20 64 12 c0       	mov    0xc0126420,%eax
c0100430:	85 c0                	test   %eax,%eax
c0100432:	75 5b                	jne    c010048f <__panic+0x6e>
        goto panic_dead;
    }
    is_panic = 1;
c0100434:	c7 05 20 64 12 c0 01 	movl   $0x1,0xc0126420
c010043b:	00 00 00 

    // print the 'message'
    va_list ap;
    va_start(ap, fmt);
c010043e:	8d 45 14             	lea    0x14(%ebp),%eax
c0100441:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel panic at %s:%d:\n    ", file, line);
c0100444:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100447:	89 44 24 08          	mov    %eax,0x8(%esp)
c010044b:	8b 45 08             	mov    0x8(%ebp),%eax
c010044e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100452:	c7 04 24 ca 95 10 c0 	movl   $0xc01095ca,(%esp)
c0100459:	e8 57 fe ff ff       	call   c01002b5 <cprintf>
    vcprintf(fmt, ap);
c010045e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100461:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100465:	8b 45 10             	mov    0x10(%ebp),%eax
c0100468:	89 04 24             	mov    %eax,(%esp)
c010046b:	e8 0e fe ff ff       	call   c010027e <vcprintf>
    cprintf("\n");
c0100470:	c7 04 24 e6 95 10 c0 	movl   $0xc01095e6,(%esp)
c0100477:	e8 39 fe ff ff       	call   c01002b5 <cprintf>
    
    cprintf("stack trackback:\n");
c010047c:	c7 04 24 e8 95 10 c0 	movl   $0xc01095e8,(%esp)
c0100483:	e8 2d fe ff ff       	call   c01002b5 <cprintf>
    print_stackframe();
c0100488:	e8 3d 06 00 00       	call   c0100aca <print_stackframe>
c010048d:	eb 01                	jmp    c0100490 <__panic+0x6f>
        goto panic_dead;
c010048f:	90                   	nop
    
    va_end(ap);

panic_dead:
    intr_disable();
c0100490:	e8 fb 14 00 00       	call   c0101990 <intr_disable>
    while (1) {
        kmonitor(NULL);
c0100495:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c010049c:	e8 74 08 00 00       	call   c0100d15 <kmonitor>
c01004a1:	eb f2                	jmp    c0100495 <__panic+0x74>

c01004a3 <__warn>:
    }
}

/* __warn - like panic, but don't */
void
__warn(const char *file, int line, const char *fmt, ...) {
c01004a3:	f3 0f 1e fb          	endbr32 
c01004a7:	55                   	push   %ebp
c01004a8:	89 e5                	mov    %esp,%ebp
c01004aa:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    va_start(ap, fmt);
c01004ad:	8d 45 14             	lea    0x14(%ebp),%eax
c01004b0:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("kernel warning at %s:%d:\n    ", file, line);
c01004b3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01004b6:	89 44 24 08          	mov    %eax,0x8(%esp)
c01004ba:	8b 45 08             	mov    0x8(%ebp),%eax
c01004bd:	89 44 24 04          	mov    %eax,0x4(%esp)
c01004c1:	c7 04 24 fa 95 10 c0 	movl   $0xc01095fa,(%esp)
c01004c8:	e8 e8 fd ff ff       	call   c01002b5 <cprintf>
    vcprintf(fmt, ap);
c01004cd:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01004d0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01004d4:	8b 45 10             	mov    0x10(%ebp),%eax
c01004d7:	89 04 24             	mov    %eax,(%esp)
c01004da:	e8 9f fd ff ff       	call   c010027e <vcprintf>
    cprintf("\n");
c01004df:	c7 04 24 e6 95 10 c0 	movl   $0xc01095e6,(%esp)
c01004e6:	e8 ca fd ff ff       	call   c01002b5 <cprintf>
    va_end(ap);
}
c01004eb:	90                   	nop
c01004ec:	c9                   	leave  
c01004ed:	c3                   	ret    

c01004ee <is_kernel_panic>:

bool
is_kernel_panic(void) {
c01004ee:	f3 0f 1e fb          	endbr32 
c01004f2:	55                   	push   %ebp
c01004f3:	89 e5                	mov    %esp,%ebp
    return is_panic;
c01004f5:	a1 20 64 12 c0       	mov    0xc0126420,%eax
}
c01004fa:	5d                   	pop    %ebp
c01004fb:	c3                   	ret    

c01004fc <stab_binsearch>:
 *      stab_binsearch(stabs, &left, &right, N_SO, 0xf0100184);
 * will exit setting left = 118, right = 554.
 * */
static void
stab_binsearch(const struct stab *stabs, int *region_left, int *region_right,
           int type, uintptr_t addr) {
c01004fc:	f3 0f 1e fb          	endbr32 
c0100500:	55                   	push   %ebp
c0100501:	89 e5                	mov    %esp,%ebp
c0100503:	83 ec 20             	sub    $0x20,%esp
    int l = *region_left, r = *region_right, any_matches = 0;
c0100506:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100509:	8b 00                	mov    (%eax),%eax
c010050b:	89 45 fc             	mov    %eax,-0x4(%ebp)
c010050e:	8b 45 10             	mov    0x10(%ebp),%eax
c0100511:	8b 00                	mov    (%eax),%eax
c0100513:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0100516:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

    while (l <= r) {
c010051d:	e9 ca 00 00 00       	jmp    c01005ec <stab_binsearch+0xf0>
        int true_m = (l + r) / 2, m = true_m;
c0100522:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100525:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0100528:	01 d0                	add    %edx,%eax
c010052a:	89 c2                	mov    %eax,%edx
c010052c:	c1 ea 1f             	shr    $0x1f,%edx
c010052f:	01 d0                	add    %edx,%eax
c0100531:	d1 f8                	sar    %eax
c0100533:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0100536:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100539:	89 45 f0             	mov    %eax,-0x10(%ebp)

        // search for earliest stab with right type
        while (m >= l && stabs[m].n_type != type) {
c010053c:	eb 03                	jmp    c0100541 <stab_binsearch+0x45>
            m --;
c010053e:	ff 4d f0             	decl   -0x10(%ebp)
        while (m >= l && stabs[m].n_type != type) {
c0100541:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100544:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c0100547:	7c 1f                	jl     c0100568 <stab_binsearch+0x6c>
c0100549:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010054c:	89 d0                	mov    %edx,%eax
c010054e:	01 c0                	add    %eax,%eax
c0100550:	01 d0                	add    %edx,%eax
c0100552:	c1 e0 02             	shl    $0x2,%eax
c0100555:	89 c2                	mov    %eax,%edx
c0100557:	8b 45 08             	mov    0x8(%ebp),%eax
c010055a:	01 d0                	add    %edx,%eax
c010055c:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c0100560:	0f b6 c0             	movzbl %al,%eax
c0100563:	39 45 14             	cmp    %eax,0x14(%ebp)
c0100566:	75 d6                	jne    c010053e <stab_binsearch+0x42>
        }
        if (m < l) {    // no match in [l, m]
c0100568:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010056b:	3b 45 fc             	cmp    -0x4(%ebp),%eax
c010056e:	7d 09                	jge    c0100579 <stab_binsearch+0x7d>
            l = true_m + 1;
c0100570:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100573:	40                   	inc    %eax
c0100574:	89 45 fc             	mov    %eax,-0x4(%ebp)
            continue;
c0100577:	eb 73                	jmp    c01005ec <stab_binsearch+0xf0>
        }

        // actual binary search
        any_matches = 1;
c0100579:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
        if (stabs[m].n_value < addr) {
c0100580:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0100583:	89 d0                	mov    %edx,%eax
c0100585:	01 c0                	add    %eax,%eax
c0100587:	01 d0                	add    %edx,%eax
c0100589:	c1 e0 02             	shl    $0x2,%eax
c010058c:	89 c2                	mov    %eax,%edx
c010058e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100591:	01 d0                	add    %edx,%eax
c0100593:	8b 40 08             	mov    0x8(%eax),%eax
c0100596:	39 45 18             	cmp    %eax,0x18(%ebp)
c0100599:	76 11                	jbe    c01005ac <stab_binsearch+0xb0>
            *region_left = m;
c010059b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010059e:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01005a1:	89 10                	mov    %edx,(%eax)
            l = true_m + 1;
c01005a3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01005a6:	40                   	inc    %eax
c01005a7:	89 45 fc             	mov    %eax,-0x4(%ebp)
c01005aa:	eb 40                	jmp    c01005ec <stab_binsearch+0xf0>
        } else if (stabs[m].n_value > addr) {
c01005ac:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01005af:	89 d0                	mov    %edx,%eax
c01005b1:	01 c0                	add    %eax,%eax
c01005b3:	01 d0                	add    %edx,%eax
c01005b5:	c1 e0 02             	shl    $0x2,%eax
c01005b8:	89 c2                	mov    %eax,%edx
c01005ba:	8b 45 08             	mov    0x8(%ebp),%eax
c01005bd:	01 d0                	add    %edx,%eax
c01005bf:	8b 40 08             	mov    0x8(%eax),%eax
c01005c2:	39 45 18             	cmp    %eax,0x18(%ebp)
c01005c5:	73 14                	jae    c01005db <stab_binsearch+0xdf>
            *region_right = m - 1;
c01005c7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01005ca:	8d 50 ff             	lea    -0x1(%eax),%edx
c01005cd:	8b 45 10             	mov    0x10(%ebp),%eax
c01005d0:	89 10                	mov    %edx,(%eax)
            r = m - 1;
c01005d2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01005d5:	48                   	dec    %eax
c01005d6:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01005d9:	eb 11                	jmp    c01005ec <stab_binsearch+0xf0>
        } else {
            // exact match for 'addr', but continue loop to find
            // *region_right
            *region_left = m;
c01005db:	8b 45 0c             	mov    0xc(%ebp),%eax
c01005de:	8b 55 f0             	mov    -0x10(%ebp),%edx
c01005e1:	89 10                	mov    %edx,(%eax)
            l = m;
c01005e3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01005e6:	89 45 fc             	mov    %eax,-0x4(%ebp)
            addr ++;
c01005e9:	ff 45 18             	incl   0x18(%ebp)
    while (l <= r) {
c01005ec:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01005ef:	3b 45 f8             	cmp    -0x8(%ebp),%eax
c01005f2:	0f 8e 2a ff ff ff    	jle    c0100522 <stab_binsearch+0x26>
        }
    }

    if (!any_matches) {
c01005f8:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01005fc:	75 0f                	jne    c010060d <stab_binsearch+0x111>
        *region_right = *region_left - 1;
c01005fe:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100601:	8b 00                	mov    (%eax),%eax
c0100603:	8d 50 ff             	lea    -0x1(%eax),%edx
c0100606:	8b 45 10             	mov    0x10(%ebp),%eax
c0100609:	89 10                	mov    %edx,(%eax)
        l = *region_right;
        for (; l > *region_left && stabs[l].n_type != type; l --)
            /* do nothing */;
        *region_left = l;
    }
}
c010060b:	eb 3e                	jmp    c010064b <stab_binsearch+0x14f>
        l = *region_right;
c010060d:	8b 45 10             	mov    0x10(%ebp),%eax
c0100610:	8b 00                	mov    (%eax),%eax
c0100612:	89 45 fc             	mov    %eax,-0x4(%ebp)
        for (; l > *region_left && stabs[l].n_type != type; l --)
c0100615:	eb 03                	jmp    c010061a <stab_binsearch+0x11e>
c0100617:	ff 4d fc             	decl   -0x4(%ebp)
c010061a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010061d:	8b 00                	mov    (%eax),%eax
c010061f:	39 45 fc             	cmp    %eax,-0x4(%ebp)
c0100622:	7e 1f                	jle    c0100643 <stab_binsearch+0x147>
c0100624:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100627:	89 d0                	mov    %edx,%eax
c0100629:	01 c0                	add    %eax,%eax
c010062b:	01 d0                	add    %edx,%eax
c010062d:	c1 e0 02             	shl    $0x2,%eax
c0100630:	89 c2                	mov    %eax,%edx
c0100632:	8b 45 08             	mov    0x8(%ebp),%eax
c0100635:	01 d0                	add    %edx,%eax
c0100637:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010063b:	0f b6 c0             	movzbl %al,%eax
c010063e:	39 45 14             	cmp    %eax,0x14(%ebp)
c0100641:	75 d4                	jne    c0100617 <stab_binsearch+0x11b>
        *region_left = l;
c0100643:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100646:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0100649:	89 10                	mov    %edx,(%eax)
}
c010064b:	90                   	nop
c010064c:	c9                   	leave  
c010064d:	c3                   	ret    

c010064e <debuginfo_eip>:
 * the specified instruction address, @addr.  Returns 0 if information
 * was found, and negative if not.  But even if it returns negative it
 * has stored some information into '*info'.
 * */
int
debuginfo_eip(uintptr_t addr, struct eipdebuginfo *info) {
c010064e:	f3 0f 1e fb          	endbr32 
c0100652:	55                   	push   %ebp
c0100653:	89 e5                	mov    %esp,%ebp
c0100655:	83 ec 58             	sub    $0x58,%esp
    const struct stab *stabs, *stab_end;
    const char *stabstr, *stabstr_end;

    info->eip_file = "<unknown>";
c0100658:	8b 45 0c             	mov    0xc(%ebp),%eax
c010065b:	c7 00 18 96 10 c0    	movl   $0xc0109618,(%eax)
    info->eip_line = 0;
c0100661:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100664:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
    info->eip_fn_name = "<unknown>";
c010066b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010066e:	c7 40 08 18 96 10 c0 	movl   $0xc0109618,0x8(%eax)
    info->eip_fn_namelen = 9;
c0100675:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100678:	c7 40 0c 09 00 00 00 	movl   $0x9,0xc(%eax)
    info->eip_fn_addr = addr;
c010067f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100682:	8b 55 08             	mov    0x8(%ebp),%edx
c0100685:	89 50 10             	mov    %edx,0x10(%eax)
    info->eip_fn_narg = 0;
c0100688:	8b 45 0c             	mov    0xc(%ebp),%eax
c010068b:	c7 40 14 00 00 00 00 	movl   $0x0,0x14(%eax)

    stabs = __STAB_BEGIN__;
c0100692:	c7 45 f4 b8 b1 10 c0 	movl   $0xc010b1b8,-0xc(%ebp)
    stab_end = __STAB_END__;
c0100699:	c7 45 f0 70 d4 11 c0 	movl   $0xc011d470,-0x10(%ebp)
    stabstr = __STABSTR_BEGIN__;
c01006a0:	c7 45 ec 71 d4 11 c0 	movl   $0xc011d471,-0x14(%ebp)
    stabstr_end = __STABSTR_END__;
c01006a7:	c7 45 e8 3a 0b 12 c0 	movl   $0xc0120b3a,-0x18(%ebp)

    // String table validity checks
    if (stabstr_end <= stabstr || stabstr_end[-1] != 0) {
c01006ae:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01006b1:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01006b4:	76 0b                	jbe    c01006c1 <debuginfo_eip+0x73>
c01006b6:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01006b9:	48                   	dec    %eax
c01006ba:	0f b6 00             	movzbl (%eax),%eax
c01006bd:	84 c0                	test   %al,%al
c01006bf:	74 0a                	je     c01006cb <debuginfo_eip+0x7d>
        return -1;
c01006c1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01006c6:	e9 ab 02 00 00       	jmp    c0100976 <debuginfo_eip+0x328>
    // 'eip'.  First, we find the basic source file containing 'eip'.
    // Then, we look in that source file for the function.  Then we look
    // for the line number.

    // Search the entire set of stabs for the source file (type N_SO).
    int lfile = 0, rfile = (stab_end - stabs) - 1;
c01006cb:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
c01006d2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01006d5:	2b 45 f4             	sub    -0xc(%ebp),%eax
c01006d8:	c1 f8 02             	sar    $0x2,%eax
c01006db:	69 c0 ab aa aa aa    	imul   $0xaaaaaaab,%eax,%eax
c01006e1:	48                   	dec    %eax
c01006e2:	89 45 e0             	mov    %eax,-0x20(%ebp)
    stab_binsearch(stabs, &lfile, &rfile, N_SO, addr);
c01006e5:	8b 45 08             	mov    0x8(%ebp),%eax
c01006e8:	89 44 24 10          	mov    %eax,0x10(%esp)
c01006ec:	c7 44 24 0c 64 00 00 	movl   $0x64,0xc(%esp)
c01006f3:	00 
c01006f4:	8d 45 e0             	lea    -0x20(%ebp),%eax
c01006f7:	89 44 24 08          	mov    %eax,0x8(%esp)
c01006fb:	8d 45 e4             	lea    -0x1c(%ebp),%eax
c01006fe:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100702:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100705:	89 04 24             	mov    %eax,(%esp)
c0100708:	e8 ef fd ff ff       	call   c01004fc <stab_binsearch>
    if (lfile == 0)
c010070d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100710:	85 c0                	test   %eax,%eax
c0100712:	75 0a                	jne    c010071e <debuginfo_eip+0xd0>
        return -1;
c0100714:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100719:	e9 58 02 00 00       	jmp    c0100976 <debuginfo_eip+0x328>

    // Search within that file's stabs for the function definition
    // (N_FUN).
    int lfun = lfile, rfun = rfile;
c010071e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0100721:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0100724:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0100727:	89 45 d8             	mov    %eax,-0x28(%ebp)
    int lline, rline;
    stab_binsearch(stabs, &lfun, &rfun, N_FUN, addr);
c010072a:	8b 45 08             	mov    0x8(%ebp),%eax
c010072d:	89 44 24 10          	mov    %eax,0x10(%esp)
c0100731:	c7 44 24 0c 24 00 00 	movl   $0x24,0xc(%esp)
c0100738:	00 
c0100739:	8d 45 d8             	lea    -0x28(%ebp),%eax
c010073c:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100740:	8d 45 dc             	lea    -0x24(%ebp),%eax
c0100743:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100747:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010074a:	89 04 24             	mov    %eax,(%esp)
c010074d:	e8 aa fd ff ff       	call   c01004fc <stab_binsearch>

    if (lfun <= rfun) {
c0100752:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0100755:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100758:	39 c2                	cmp    %eax,%edx
c010075a:	7f 78                	jg     c01007d4 <debuginfo_eip+0x186>
        // stabs[lfun] points to the function name
        // in the string table, but check bounds just in case.
        if (stabs[lfun].n_strx < stabstr_end - stabstr) {
c010075c:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010075f:	89 c2                	mov    %eax,%edx
c0100761:	89 d0                	mov    %edx,%eax
c0100763:	01 c0                	add    %eax,%eax
c0100765:	01 d0                	add    %edx,%eax
c0100767:	c1 e0 02             	shl    $0x2,%eax
c010076a:	89 c2                	mov    %eax,%edx
c010076c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010076f:	01 d0                	add    %edx,%eax
c0100771:	8b 10                	mov    (%eax),%edx
c0100773:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100776:	2b 45 ec             	sub    -0x14(%ebp),%eax
c0100779:	39 c2                	cmp    %eax,%edx
c010077b:	73 22                	jae    c010079f <debuginfo_eip+0x151>
            info->eip_fn_name = stabstr + stabs[lfun].n_strx;
c010077d:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100780:	89 c2                	mov    %eax,%edx
c0100782:	89 d0                	mov    %edx,%eax
c0100784:	01 c0                	add    %eax,%eax
c0100786:	01 d0                	add    %edx,%eax
c0100788:	c1 e0 02             	shl    $0x2,%eax
c010078b:	89 c2                	mov    %eax,%edx
c010078d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100790:	01 d0                	add    %edx,%eax
c0100792:	8b 10                	mov    (%eax),%edx
c0100794:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0100797:	01 c2                	add    %eax,%edx
c0100799:	8b 45 0c             	mov    0xc(%ebp),%eax
c010079c:	89 50 08             	mov    %edx,0x8(%eax)
        }
        info->eip_fn_addr = stabs[lfun].n_value;
c010079f:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01007a2:	89 c2                	mov    %eax,%edx
c01007a4:	89 d0                	mov    %edx,%eax
c01007a6:	01 c0                	add    %eax,%eax
c01007a8:	01 d0                	add    %edx,%eax
c01007aa:	c1 e0 02             	shl    $0x2,%eax
c01007ad:	89 c2                	mov    %eax,%edx
c01007af:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01007b2:	01 d0                	add    %edx,%eax
c01007b4:	8b 50 08             	mov    0x8(%eax),%edx
c01007b7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01007ba:	89 50 10             	mov    %edx,0x10(%eax)
        addr -= info->eip_fn_addr;
c01007bd:	8b 45 0c             	mov    0xc(%ebp),%eax
c01007c0:	8b 40 10             	mov    0x10(%eax),%eax
c01007c3:	29 45 08             	sub    %eax,0x8(%ebp)
        // Search within the function definition for the line number.
        lline = lfun;
c01007c6:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01007c9:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfun;
c01007cc:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01007cf:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01007d2:	eb 15                	jmp    c01007e9 <debuginfo_eip+0x19b>
    } else {
        // Couldn't find function stab!  Maybe we're in an assembly
        // file.  Search the whole file for the line number.
        info->eip_fn_addr = addr;
c01007d4:	8b 45 0c             	mov    0xc(%ebp),%eax
c01007d7:	8b 55 08             	mov    0x8(%ebp),%edx
c01007da:	89 50 10             	mov    %edx,0x10(%eax)
        lline = lfile;
c01007dd:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01007e0:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        rline = rfile;
c01007e3:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01007e6:	89 45 d0             	mov    %eax,-0x30(%ebp)
    }
    info->eip_fn_namelen = strfind(info->eip_fn_name, ':') - info->eip_fn_name;
c01007e9:	8b 45 0c             	mov    0xc(%ebp),%eax
c01007ec:	8b 40 08             	mov    0x8(%eax),%eax
c01007ef:	c7 44 24 04 3a 00 00 	movl   $0x3a,0x4(%esp)
c01007f6:	00 
c01007f7:	89 04 24             	mov    %eax,(%esp)
c01007fa:	e8 53 83 00 00       	call   c0108b52 <strfind>
c01007ff:	8b 55 0c             	mov    0xc(%ebp),%edx
c0100802:	8b 52 08             	mov    0x8(%edx),%edx
c0100805:	29 d0                	sub    %edx,%eax
c0100807:	89 c2                	mov    %eax,%edx
c0100809:	8b 45 0c             	mov    0xc(%ebp),%eax
c010080c:	89 50 0c             	mov    %edx,0xc(%eax)

    // Search within [lline, rline] for the line number stab.
    // If found, set info->eip_line to the right line number.
    // If not found, return -1.
    stab_binsearch(stabs, &lline, &rline, N_SLINE, addr);
c010080f:	8b 45 08             	mov    0x8(%ebp),%eax
c0100812:	89 44 24 10          	mov    %eax,0x10(%esp)
c0100816:	c7 44 24 0c 44 00 00 	movl   $0x44,0xc(%esp)
c010081d:	00 
c010081e:	8d 45 d0             	lea    -0x30(%ebp),%eax
c0100821:	89 44 24 08          	mov    %eax,0x8(%esp)
c0100825:	8d 45 d4             	lea    -0x2c(%ebp),%eax
c0100828:	89 44 24 04          	mov    %eax,0x4(%esp)
c010082c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010082f:	89 04 24             	mov    %eax,(%esp)
c0100832:	e8 c5 fc ff ff       	call   c01004fc <stab_binsearch>
    if (lline <= rline) {
c0100837:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010083a:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010083d:	39 c2                	cmp    %eax,%edx
c010083f:	7f 23                	jg     c0100864 <debuginfo_eip+0x216>
        info->eip_line = stabs[rline].n_desc;
c0100841:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0100844:	89 c2                	mov    %eax,%edx
c0100846:	89 d0                	mov    %edx,%eax
c0100848:	01 c0                	add    %eax,%eax
c010084a:	01 d0                	add    %edx,%eax
c010084c:	c1 e0 02             	shl    $0x2,%eax
c010084f:	89 c2                	mov    %eax,%edx
c0100851:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100854:	01 d0                	add    %edx,%eax
c0100856:	0f b7 40 06          	movzwl 0x6(%eax),%eax
c010085a:	89 c2                	mov    %eax,%edx
c010085c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010085f:	89 50 04             	mov    %edx,0x4(%eax)

    // Search backwards from the line number for the relevant filename stab.
    // We can't just use the "lfile" stab because inlined functions
    // can interpolate code from a different file!
    // Such included source files use the N_SOL stab type.
    while (lline >= lfile
c0100862:	eb 11                	jmp    c0100875 <debuginfo_eip+0x227>
        return -1;
c0100864:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0100869:	e9 08 01 00 00       	jmp    c0100976 <debuginfo_eip+0x328>
           && stabs[lline].n_type != N_SOL
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
        lline --;
c010086e:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100871:	48                   	dec    %eax
c0100872:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    while (lline >= lfile
c0100875:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0100878:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010087b:	39 c2                	cmp    %eax,%edx
c010087d:	7c 56                	jl     c01008d5 <debuginfo_eip+0x287>
           && stabs[lline].n_type != N_SOL
c010087f:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100882:	89 c2                	mov    %eax,%edx
c0100884:	89 d0                	mov    %edx,%eax
c0100886:	01 c0                	add    %eax,%eax
c0100888:	01 d0                	add    %edx,%eax
c010088a:	c1 e0 02             	shl    $0x2,%eax
c010088d:	89 c2                	mov    %eax,%edx
c010088f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100892:	01 d0                	add    %edx,%eax
c0100894:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c0100898:	3c 84                	cmp    $0x84,%al
c010089a:	74 39                	je     c01008d5 <debuginfo_eip+0x287>
           && (stabs[lline].n_type != N_SO || !stabs[lline].n_value)) {
c010089c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010089f:	89 c2                	mov    %eax,%edx
c01008a1:	89 d0                	mov    %edx,%eax
c01008a3:	01 c0                	add    %eax,%eax
c01008a5:	01 d0                	add    %edx,%eax
c01008a7:	c1 e0 02             	shl    $0x2,%eax
c01008aa:	89 c2                	mov    %eax,%edx
c01008ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01008af:	01 d0                	add    %edx,%eax
c01008b1:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c01008b5:	3c 64                	cmp    $0x64,%al
c01008b7:	75 b5                	jne    c010086e <debuginfo_eip+0x220>
c01008b9:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01008bc:	89 c2                	mov    %eax,%edx
c01008be:	89 d0                	mov    %edx,%eax
c01008c0:	01 c0                	add    %eax,%eax
c01008c2:	01 d0                	add    %edx,%eax
c01008c4:	c1 e0 02             	shl    $0x2,%eax
c01008c7:	89 c2                	mov    %eax,%edx
c01008c9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01008cc:	01 d0                	add    %edx,%eax
c01008ce:	8b 40 08             	mov    0x8(%eax),%eax
c01008d1:	85 c0                	test   %eax,%eax
c01008d3:	74 99                	je     c010086e <debuginfo_eip+0x220>
    }
    if (lline >= lfile && stabs[lline].n_strx < stabstr_end - stabstr) {
c01008d5:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01008d8:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01008db:	39 c2                	cmp    %eax,%edx
c01008dd:	7c 42                	jl     c0100921 <debuginfo_eip+0x2d3>
c01008df:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01008e2:	89 c2                	mov    %eax,%edx
c01008e4:	89 d0                	mov    %edx,%eax
c01008e6:	01 c0                	add    %eax,%eax
c01008e8:	01 d0                	add    %edx,%eax
c01008ea:	c1 e0 02             	shl    $0x2,%eax
c01008ed:	89 c2                	mov    %eax,%edx
c01008ef:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01008f2:	01 d0                	add    %edx,%eax
c01008f4:	8b 10                	mov    (%eax),%edx
c01008f6:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01008f9:	2b 45 ec             	sub    -0x14(%ebp),%eax
c01008fc:	39 c2                	cmp    %eax,%edx
c01008fe:	73 21                	jae    c0100921 <debuginfo_eip+0x2d3>
        info->eip_file = stabstr + stabs[lline].n_strx;
c0100900:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100903:	89 c2                	mov    %eax,%edx
c0100905:	89 d0                	mov    %edx,%eax
c0100907:	01 c0                	add    %eax,%eax
c0100909:	01 d0                	add    %edx,%eax
c010090b:	c1 e0 02             	shl    $0x2,%eax
c010090e:	89 c2                	mov    %eax,%edx
c0100910:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100913:	01 d0                	add    %edx,%eax
c0100915:	8b 10                	mov    (%eax),%edx
c0100917:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010091a:	01 c2                	add    %eax,%edx
c010091c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010091f:	89 10                	mov    %edx,(%eax)
    }

    // Set eip_fn_narg to the number of arguments taken by the function,
    // or 0 if there was no containing function.
    if (lfun < rfun) {
c0100921:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0100924:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0100927:	39 c2                	cmp    %eax,%edx
c0100929:	7d 46                	jge    c0100971 <debuginfo_eip+0x323>
        for (lline = lfun + 1;
c010092b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010092e:	40                   	inc    %eax
c010092f:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c0100932:	eb 16                	jmp    c010094a <debuginfo_eip+0x2fc>
             lline < rfun && stabs[lline].n_type == N_PSYM;
             lline ++) {
            info->eip_fn_narg ++;
c0100934:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100937:	8b 40 14             	mov    0x14(%eax),%eax
c010093a:	8d 50 01             	lea    0x1(%eax),%edx
c010093d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100940:	89 50 14             	mov    %edx,0x14(%eax)
             lline ++) {
c0100943:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100946:	40                   	inc    %eax
c0100947:	89 45 d4             	mov    %eax,-0x2c(%ebp)
             lline < rfun && stabs[lline].n_type == N_PSYM;
c010094a:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010094d:	8b 45 d8             	mov    -0x28(%ebp),%eax
        for (lline = lfun + 1;
c0100950:	39 c2                	cmp    %eax,%edx
c0100952:	7d 1d                	jge    c0100971 <debuginfo_eip+0x323>
             lline < rfun && stabs[lline].n_type == N_PSYM;
c0100954:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0100957:	89 c2                	mov    %eax,%edx
c0100959:	89 d0                	mov    %edx,%eax
c010095b:	01 c0                	add    %eax,%eax
c010095d:	01 d0                	add    %edx,%eax
c010095f:	c1 e0 02             	shl    $0x2,%eax
c0100962:	89 c2                	mov    %eax,%edx
c0100964:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100967:	01 d0                	add    %edx,%eax
c0100969:	0f b6 40 04          	movzbl 0x4(%eax),%eax
c010096d:	3c a0                	cmp    $0xa0,%al
c010096f:	74 c3                	je     c0100934 <debuginfo_eip+0x2e6>
        }
    }
    return 0;
c0100971:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100976:	c9                   	leave  
c0100977:	c3                   	ret    

c0100978 <print_kerninfo>:
 * print_kerninfo - print the information about kernel, including the location
 * of kernel entry, the start addresses of data and text segements, the start
 * address of free memory and how many memory that kernel has used.
 * */
void
print_kerninfo(void) {
c0100978:	f3 0f 1e fb          	endbr32 
c010097c:	55                   	push   %ebp
c010097d:	89 e5                	mov    %esp,%ebp
c010097f:	83 ec 18             	sub    $0x18,%esp
    extern char etext[], edata[], end[], kern_init[];
    cprintf("Special kernel symbols:\n");
c0100982:	c7 04 24 22 96 10 c0 	movl   $0xc0109622,(%esp)
c0100989:	e8 27 f9 ff ff       	call   c01002b5 <cprintf>
    cprintf("  entry  0x%08x (phys)\n", kern_init);
c010098e:	c7 44 24 04 36 00 10 	movl   $0xc0100036,0x4(%esp)
c0100995:	c0 
c0100996:	c7 04 24 3b 96 10 c0 	movl   $0xc010963b,(%esp)
c010099d:	e8 13 f9 ff ff       	call   c01002b5 <cprintf>
    cprintf("  etext  0x%08x (phys)\n", etext);
c01009a2:	c7 44 24 04 02 95 10 	movl   $0xc0109502,0x4(%esp)
c01009a9:	c0 
c01009aa:	c7 04 24 53 96 10 c0 	movl   $0xc0109653,(%esp)
c01009b1:	e8 ff f8 ff ff       	call   c01002b5 <cprintf>
    cprintf("  edata  0x%08x (phys)\n", edata);
c01009b6:	c7 44 24 04 00 60 12 	movl   $0xc0126000,0x4(%esp)
c01009bd:	c0 
c01009be:	c7 04 24 6b 96 10 c0 	movl   $0xc010966b,(%esp)
c01009c5:	e8 eb f8 ff ff       	call   c01002b5 <cprintf>
    cprintf("  end    0x%08x (phys)\n", end);
c01009ca:	c7 44 24 04 d0 da 2a 	movl   $0xc02adad0,0x4(%esp)
c01009d1:	c0 
c01009d2:	c7 04 24 83 96 10 c0 	movl   $0xc0109683,(%esp)
c01009d9:	e8 d7 f8 ff ff       	call   c01002b5 <cprintf>
    cprintf("Kernel executable memory footprint: %dKB\n", (end - kern_init + 1023)/1024);
c01009de:	b8 d0 da 2a c0       	mov    $0xc02adad0,%eax
c01009e3:	2d 36 00 10 c0       	sub    $0xc0100036,%eax
c01009e8:	05 ff 03 00 00       	add    $0x3ff,%eax
c01009ed:	8d 90 ff 03 00 00    	lea    0x3ff(%eax),%edx
c01009f3:	85 c0                	test   %eax,%eax
c01009f5:	0f 48 c2             	cmovs  %edx,%eax
c01009f8:	c1 f8 0a             	sar    $0xa,%eax
c01009fb:	89 44 24 04          	mov    %eax,0x4(%esp)
c01009ff:	c7 04 24 9c 96 10 c0 	movl   $0xc010969c,(%esp)
c0100a06:	e8 aa f8 ff ff       	call   c01002b5 <cprintf>
}
c0100a0b:	90                   	nop
c0100a0c:	c9                   	leave  
c0100a0d:	c3                   	ret    

c0100a0e <print_debuginfo>:
/* *
 * print_debuginfo - read and print the stat information for the address @eip,
 * and info.eip_fn_addr should be the first address of the related function.
 * */
void
print_debuginfo(uintptr_t eip) {
c0100a0e:	f3 0f 1e fb          	endbr32 
c0100a12:	55                   	push   %ebp
c0100a13:	89 e5                	mov    %esp,%ebp
c0100a15:	81 ec 48 01 00 00    	sub    $0x148,%esp
    struct eipdebuginfo info;
    if (debuginfo_eip(eip, &info) != 0) {
c0100a1b:	8d 45 dc             	lea    -0x24(%ebp),%eax
c0100a1e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100a22:	8b 45 08             	mov    0x8(%ebp),%eax
c0100a25:	89 04 24             	mov    %eax,(%esp)
c0100a28:	e8 21 fc ff ff       	call   c010064e <debuginfo_eip>
c0100a2d:	85 c0                	test   %eax,%eax
c0100a2f:	74 15                	je     c0100a46 <print_debuginfo+0x38>
        cprintf("    <unknow>: -- 0x%08x --\n", eip);
c0100a31:	8b 45 08             	mov    0x8(%ebp),%eax
c0100a34:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100a38:	c7 04 24 c6 96 10 c0 	movl   $0xc01096c6,(%esp)
c0100a3f:	e8 71 f8 ff ff       	call   c01002b5 <cprintf>
        }
        fnname[j] = '\0';
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
                fnname, eip - info.eip_fn_addr);
    }
}
c0100a44:	eb 6c                	jmp    c0100ab2 <print_debuginfo+0xa4>
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c0100a46:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100a4d:	eb 1b                	jmp    c0100a6a <print_debuginfo+0x5c>
            fnname[j] = info.eip_fn_name[j];
c0100a4f:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0100a52:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a55:	01 d0                	add    %edx,%eax
c0100a57:	0f b6 10             	movzbl (%eax),%edx
c0100a5a:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c0100a60:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a63:	01 c8                	add    %ecx,%eax
c0100a65:	88 10                	mov    %dl,(%eax)
        for (j = 0; j < info.eip_fn_namelen; j ++) {
c0100a67:	ff 45 f4             	incl   -0xc(%ebp)
c0100a6a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0100a6d:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0100a70:	7c dd                	jl     c0100a4f <print_debuginfo+0x41>
        fnname[j] = '\0';
c0100a72:	8d 95 dc fe ff ff    	lea    -0x124(%ebp),%edx
c0100a78:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100a7b:	01 d0                	add    %edx,%eax
c0100a7d:	c6 00 00             	movb   $0x0,(%eax)
                fnname, eip - info.eip_fn_addr);
c0100a80:	8b 45 ec             	mov    -0x14(%ebp),%eax
        cprintf("    %s:%d: %s+%d\n", info.eip_file, info.eip_line,
c0100a83:	8b 55 08             	mov    0x8(%ebp),%edx
c0100a86:	89 d1                	mov    %edx,%ecx
c0100a88:	29 c1                	sub    %eax,%ecx
c0100a8a:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0100a8d:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0100a90:	89 4c 24 10          	mov    %ecx,0x10(%esp)
c0100a94:	8d 8d dc fe ff ff    	lea    -0x124(%ebp),%ecx
c0100a9a:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c0100a9e:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100aa2:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100aa6:	c7 04 24 e2 96 10 c0 	movl   $0xc01096e2,(%esp)
c0100aad:	e8 03 f8 ff ff       	call   c01002b5 <cprintf>
}
c0100ab2:	90                   	nop
c0100ab3:	c9                   	leave  
c0100ab4:	c3                   	ret    

c0100ab5 <read_eip>:

static __noinline uint32_t
read_eip(void) {
c0100ab5:	f3 0f 1e fb          	endbr32 
c0100ab9:	55                   	push   %ebp
c0100aba:	89 e5                	mov    %esp,%ebp
c0100abc:	83 ec 10             	sub    $0x10,%esp
    uint32_t eip;
    asm volatile("movl 4(%%ebp), %0" : "=r" (eip));
c0100abf:	8b 45 04             	mov    0x4(%ebp),%eax
c0100ac2:	89 45 fc             	mov    %eax,-0x4(%ebp)
    return eip;
c0100ac5:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0100ac8:	c9                   	leave  
c0100ac9:	c3                   	ret    

c0100aca <print_stackframe>:
 *
 * Note that, the length of ebp-chain is limited. In boot/bootasm.S, before jumping
 * to the kernel entry, the value of ebp has been set to zero, that's the boundary.
 * */
void
print_stackframe(void) {
c0100aca:	f3 0f 1e fb          	endbr32 
c0100ace:	55                   	push   %ebp
c0100acf:	89 e5                	mov    %esp,%ebp
c0100ad1:	53                   	push   %ebx
c0100ad2:	83 ec 34             	sub    $0x34,%esp
}

static inline uint32_t
read_ebp(void) {
    uint32_t ebp;
    asm volatile ("movl %%ebp, %0" : "=r" (ebp));
c0100ad5:	89 e8                	mov    %ebp,%eax
c0100ad7:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return ebp;
c0100ada:	8b 45 e8             	mov    -0x18(%ebp),%eax
      *    (3.4) call print_debuginfo(eip-1) to print the C calling function name and line number, etc.
      *    (3.5) popup a calling stackframe
      *           NOTICE: the calling funciton's return addr eip  = ss:[ebp+4]
      *                   the calling funciton's ebp = ss:[ebp]
      */
      uint32_t ebp=read_ebp();
c0100add:	89 45 f4             	mov    %eax,-0xc(%ebp)
      uint32_t eip=read_eip();
c0100ae0:	e8 d0 ff ff ff       	call   c0100ab5 <read_eip>
c0100ae5:	89 45 f0             	mov    %eax,-0x10(%ebp)
      int dpt=0;
c0100ae8:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
      while(eip&&ebp&&dpt<STACKFRAME_DEPTH)
c0100aef:	e9 90 00 00 00       	jmp    c0100b84 <print_stackframe+0xba>
      {
	cprintf("the value of ebp ==> 0x%08x\n",ebp);
c0100af4:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100af7:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100afb:	c7 04 24 f4 96 10 c0 	movl   $0xc01096f4,(%esp)
c0100b02:	e8 ae f7 ff ff       	call   c01002b5 <cprintf>
	cprintf("the value of eip ==> 0x%08x\n",eip);
c0100b07:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b0a:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100b0e:	c7 04 24 11 97 10 c0 	movl   $0xc0109711,(%esp)
c0100b15:	e8 9b f7 ff ff       	call   c01002b5 <cprintf>
	cprintf("args:0x%08x 0x%08x 0x%08x 0x%08x\n",*(unsigned int*)(ebp+8),*(unsigned int*)(ebp+12),*(unsigned int*)(ebp+16),*(unsigned int*)(ebp+20) );
c0100b1a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b1d:	83 c0 14             	add    $0x14,%eax
c0100b20:	8b 18                	mov    (%eax),%ebx
c0100b22:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b25:	83 c0 10             	add    $0x10,%eax
c0100b28:	8b 08                	mov    (%eax),%ecx
c0100b2a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b2d:	83 c0 0c             	add    $0xc,%eax
c0100b30:	8b 10                	mov    (%eax),%edx
c0100b32:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b35:	83 c0 08             	add    $0x8,%eax
c0100b38:	8b 00                	mov    (%eax),%eax
c0100b3a:	89 5c 24 10          	mov    %ebx,0x10(%esp)
c0100b3e:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c0100b42:	89 54 24 08          	mov    %edx,0x8(%esp)
c0100b46:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100b4a:	c7 04 24 30 97 10 c0 	movl   $0xc0109730,(%esp)
c0100b51:	e8 5f f7 ff ff       	call   c01002b5 <cprintf>
	print_debuginfo(eip-1);
c0100b56:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0100b59:	48                   	dec    %eax
c0100b5a:	89 04 24             	mov    %eax,(%esp)
c0100b5d:	e8 ac fe ff ff       	call   c0100a0e <print_debuginfo>
	cprintf("\n");
c0100b62:	c7 04 24 52 97 10 c0 	movl   $0xc0109752,(%esp)
c0100b69:	e8 47 f7 ff ff       	call   c01002b5 <cprintf>
	eip=*(uint32_t*)(ebp+4);
c0100b6e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b71:	83 c0 04             	add    $0x4,%eax
c0100b74:	8b 00                	mov    (%eax),%eax
c0100b76:	89 45 f0             	mov    %eax,-0x10(%ebp)
	ebp=*(uint32_t*)ebp;
c0100b79:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100b7c:	8b 00                	mov    (%eax),%eax
c0100b7e:	89 45 f4             	mov    %eax,-0xc(%ebp)
	dpt++;
c0100b81:	ff 45 ec             	incl   -0x14(%ebp)
      while(eip&&ebp&&dpt<STACKFRAME_DEPTH)
c0100b84:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100b88:	74 10                	je     c0100b9a <print_stackframe+0xd0>
c0100b8a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100b8e:	74 0a                	je     c0100b9a <print_stackframe+0xd0>
c0100b90:	83 7d ec 13          	cmpl   $0x13,-0x14(%ebp)
c0100b94:	0f 8e 5a ff ff ff    	jle    c0100af4 <print_stackframe+0x2a>
      }
}
c0100b9a:	90                   	nop
c0100b9b:	83 c4 34             	add    $0x34,%esp
c0100b9e:	5b                   	pop    %ebx
c0100b9f:	5d                   	pop    %ebp
c0100ba0:	c3                   	ret    

c0100ba1 <parse>:
#define MAXARGS         16
#define WHITESPACE      " \t\n\r"

/* parse - parse the command buffer into whitespace-separated arguments */
static int
parse(char *buf, char **argv) {
c0100ba1:	f3 0f 1e fb          	endbr32 
c0100ba5:	55                   	push   %ebp
c0100ba6:	89 e5                	mov    %esp,%ebp
c0100ba8:	83 ec 28             	sub    $0x28,%esp
    int argc = 0;
c0100bab:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    while (1) {
        // find global whitespace
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100bb2:	eb 0c                	jmp    c0100bc0 <parse+0x1f>
            *buf ++ = '\0';
c0100bb4:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bb7:	8d 50 01             	lea    0x1(%eax),%edx
c0100bba:	89 55 08             	mov    %edx,0x8(%ebp)
c0100bbd:	c6 00 00             	movb   $0x0,(%eax)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100bc0:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bc3:	0f b6 00             	movzbl (%eax),%eax
c0100bc6:	84 c0                	test   %al,%al
c0100bc8:	74 1d                	je     c0100be7 <parse+0x46>
c0100bca:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bcd:	0f b6 00             	movzbl (%eax),%eax
c0100bd0:	0f be c0             	movsbl %al,%eax
c0100bd3:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100bd7:	c7 04 24 d4 97 10 c0 	movl   $0xc01097d4,(%esp)
c0100bde:	e8 39 7f 00 00       	call   c0108b1c <strchr>
c0100be3:	85 c0                	test   %eax,%eax
c0100be5:	75 cd                	jne    c0100bb4 <parse+0x13>
        }
        if (*buf == '\0') {
c0100be7:	8b 45 08             	mov    0x8(%ebp),%eax
c0100bea:	0f b6 00             	movzbl (%eax),%eax
c0100bed:	84 c0                	test   %al,%al
c0100bef:	74 65                	je     c0100c56 <parse+0xb5>
            break;
        }

        // save and scan past next arg
        if (argc == MAXARGS - 1) {
c0100bf1:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
c0100bf5:	75 14                	jne    c0100c0b <parse+0x6a>
            cprintf("Too many arguments (max %d).\n", MAXARGS);
c0100bf7:	c7 44 24 04 10 00 00 	movl   $0x10,0x4(%esp)
c0100bfe:	00 
c0100bff:	c7 04 24 d9 97 10 c0 	movl   $0xc01097d9,(%esp)
c0100c06:	e8 aa f6 ff ff       	call   c01002b5 <cprintf>
        }
        argv[argc ++] = buf;
c0100c0b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100c0e:	8d 50 01             	lea    0x1(%eax),%edx
c0100c11:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0100c14:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0100c1b:	8b 45 0c             	mov    0xc(%ebp),%eax
c0100c1e:	01 c2                	add    %eax,%edx
c0100c20:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c23:	89 02                	mov    %eax,(%edx)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100c25:	eb 03                	jmp    c0100c2a <parse+0x89>
            buf ++;
c0100c27:	ff 45 08             	incl   0x8(%ebp)
        while (*buf != '\0' && strchr(WHITESPACE, *buf) == NULL) {
c0100c2a:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c2d:	0f b6 00             	movzbl (%eax),%eax
c0100c30:	84 c0                	test   %al,%al
c0100c32:	74 8c                	je     c0100bc0 <parse+0x1f>
c0100c34:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c37:	0f b6 00             	movzbl (%eax),%eax
c0100c3a:	0f be c0             	movsbl %al,%eax
c0100c3d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100c41:	c7 04 24 d4 97 10 c0 	movl   $0xc01097d4,(%esp)
c0100c48:	e8 cf 7e 00 00       	call   c0108b1c <strchr>
c0100c4d:	85 c0                	test   %eax,%eax
c0100c4f:	74 d6                	je     c0100c27 <parse+0x86>
        while (*buf != '\0' && strchr(WHITESPACE, *buf) != NULL) {
c0100c51:	e9 6a ff ff ff       	jmp    c0100bc0 <parse+0x1f>
            break;
c0100c56:	90                   	nop
        }
    }
    return argc;
c0100c57:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0100c5a:	c9                   	leave  
c0100c5b:	c3                   	ret    

c0100c5c <runcmd>:
/* *
 * runcmd - parse the input string, split it into separated arguments
 * and then lookup and invoke some related commands/
 * */
static int
runcmd(char *buf, struct trapframe *tf) {
c0100c5c:	f3 0f 1e fb          	endbr32 
c0100c60:	55                   	push   %ebp
c0100c61:	89 e5                	mov    %esp,%ebp
c0100c63:	53                   	push   %ebx
c0100c64:	83 ec 64             	sub    $0x64,%esp
    char *argv[MAXARGS];
    int argc = parse(buf, argv);
c0100c67:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100c6a:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100c6e:	8b 45 08             	mov    0x8(%ebp),%eax
c0100c71:	89 04 24             	mov    %eax,(%esp)
c0100c74:	e8 28 ff ff ff       	call   c0100ba1 <parse>
c0100c79:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if (argc == 0) {
c0100c7c:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0100c80:	75 0a                	jne    c0100c8c <runcmd+0x30>
        return 0;
c0100c82:	b8 00 00 00 00       	mov    $0x0,%eax
c0100c87:	e9 83 00 00 00       	jmp    c0100d0f <runcmd+0xb3>
    }
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100c8c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100c93:	eb 5a                	jmp    c0100cef <runcmd+0x93>
        if (strcmp(commands[i].name, argv[0]) == 0) {
c0100c95:	8b 4d b0             	mov    -0x50(%ebp),%ecx
c0100c98:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100c9b:	89 d0                	mov    %edx,%eax
c0100c9d:	01 c0                	add    %eax,%eax
c0100c9f:	01 d0                	add    %edx,%eax
c0100ca1:	c1 e0 02             	shl    $0x2,%eax
c0100ca4:	05 00 30 12 c0       	add    $0xc0123000,%eax
c0100ca9:	8b 00                	mov    (%eax),%eax
c0100cab:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c0100caf:	89 04 24             	mov    %eax,(%esp)
c0100cb2:	e8 c1 7d 00 00       	call   c0108a78 <strcmp>
c0100cb7:	85 c0                	test   %eax,%eax
c0100cb9:	75 31                	jne    c0100cec <runcmd+0x90>
            return commands[i].func(argc - 1, argv + 1, tf);
c0100cbb:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100cbe:	89 d0                	mov    %edx,%eax
c0100cc0:	01 c0                	add    %eax,%eax
c0100cc2:	01 d0                	add    %edx,%eax
c0100cc4:	c1 e0 02             	shl    $0x2,%eax
c0100cc7:	05 08 30 12 c0       	add    $0xc0123008,%eax
c0100ccc:	8b 10                	mov    (%eax),%edx
c0100cce:	8d 45 b0             	lea    -0x50(%ebp),%eax
c0100cd1:	83 c0 04             	add    $0x4,%eax
c0100cd4:	8b 4d f0             	mov    -0x10(%ebp),%ecx
c0100cd7:	8d 59 ff             	lea    -0x1(%ecx),%ebx
c0100cda:	8b 4d 0c             	mov    0xc(%ebp),%ecx
c0100cdd:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0100ce1:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100ce5:	89 1c 24             	mov    %ebx,(%esp)
c0100ce8:	ff d2                	call   *%edx
c0100cea:	eb 23                	jmp    c0100d0f <runcmd+0xb3>
    for (i = 0; i < NCOMMANDS; i ++) {
c0100cec:	ff 45 f4             	incl   -0xc(%ebp)
c0100cef:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100cf2:	83 f8 02             	cmp    $0x2,%eax
c0100cf5:	76 9e                	jbe    c0100c95 <runcmd+0x39>
        }
    }
    cprintf("Unknown command '%s'\n", argv[0]);
c0100cf7:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0100cfa:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100cfe:	c7 04 24 f7 97 10 c0 	movl   $0xc01097f7,(%esp)
c0100d05:	e8 ab f5 ff ff       	call   c01002b5 <cprintf>
    return 0;
c0100d0a:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100d0f:	83 c4 64             	add    $0x64,%esp
c0100d12:	5b                   	pop    %ebx
c0100d13:	5d                   	pop    %ebp
c0100d14:	c3                   	ret    

c0100d15 <kmonitor>:

/***** Implementations of basic kernel monitor commands *****/

void
kmonitor(struct trapframe *tf) {
c0100d15:	f3 0f 1e fb          	endbr32 
c0100d19:	55                   	push   %ebp
c0100d1a:	89 e5                	mov    %esp,%ebp
c0100d1c:	83 ec 28             	sub    $0x28,%esp
    cprintf("Welcome to the kernel debug monitor!!\n");
c0100d1f:	c7 04 24 10 98 10 c0 	movl   $0xc0109810,(%esp)
c0100d26:	e8 8a f5 ff ff       	call   c01002b5 <cprintf>
    cprintf("Type 'help' for a list of commands.\n");
c0100d2b:	c7 04 24 38 98 10 c0 	movl   $0xc0109838,(%esp)
c0100d32:	e8 7e f5 ff ff       	call   c01002b5 <cprintf>

    if (tf != NULL) {
c0100d37:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100d3b:	74 0b                	je     c0100d48 <kmonitor+0x33>
        print_trapframe(tf);
c0100d3d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100d40:	89 04 24             	mov    %eax,(%esp)
c0100d43:	e8 b5 0e 00 00       	call   c0101bfd <print_trapframe>
    }

    char *buf;
    while (1) {
        if ((buf = readline("K> ")) != NULL) {
c0100d48:	c7 04 24 5d 98 10 c0 	movl   $0xc010985d,(%esp)
c0100d4f:	e8 14 f6 ff ff       	call   c0100368 <readline>
c0100d54:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0100d57:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0100d5b:	74 eb                	je     c0100d48 <kmonitor+0x33>
            if (runcmd(buf, tf) < 0) {
c0100d5d:	8b 45 08             	mov    0x8(%ebp),%eax
c0100d60:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100d64:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100d67:	89 04 24             	mov    %eax,(%esp)
c0100d6a:	e8 ed fe ff ff       	call   c0100c5c <runcmd>
c0100d6f:	85 c0                	test   %eax,%eax
c0100d71:	78 02                	js     c0100d75 <kmonitor+0x60>
        if ((buf = readline("K> ")) != NULL) {
c0100d73:	eb d3                	jmp    c0100d48 <kmonitor+0x33>
                break;
c0100d75:	90                   	nop
            }
        }
    }
}
c0100d76:	90                   	nop
c0100d77:	c9                   	leave  
c0100d78:	c3                   	ret    

c0100d79 <mon_help>:

/* mon_help - print the information about mon_* functions */
int
mon_help(int argc, char **argv, struct trapframe *tf) {
c0100d79:	f3 0f 1e fb          	endbr32 
c0100d7d:	55                   	push   %ebp
c0100d7e:	89 e5                	mov    %esp,%ebp
c0100d80:	83 ec 28             	sub    $0x28,%esp
    int i;
    for (i = 0; i < NCOMMANDS; i ++) {
c0100d83:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0100d8a:	eb 3d                	jmp    c0100dc9 <mon_help+0x50>
        cprintf("%s - %s\n", commands[i].name, commands[i].desc);
c0100d8c:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100d8f:	89 d0                	mov    %edx,%eax
c0100d91:	01 c0                	add    %eax,%eax
c0100d93:	01 d0                	add    %edx,%eax
c0100d95:	c1 e0 02             	shl    $0x2,%eax
c0100d98:	05 04 30 12 c0       	add    $0xc0123004,%eax
c0100d9d:	8b 08                	mov    (%eax),%ecx
c0100d9f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0100da2:	89 d0                	mov    %edx,%eax
c0100da4:	01 c0                	add    %eax,%eax
c0100da6:	01 d0                	add    %edx,%eax
c0100da8:	c1 e0 02             	shl    $0x2,%eax
c0100dab:	05 00 30 12 c0       	add    $0xc0123000,%eax
c0100db0:	8b 00                	mov    (%eax),%eax
c0100db2:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c0100db6:	89 44 24 04          	mov    %eax,0x4(%esp)
c0100dba:	c7 04 24 61 98 10 c0 	movl   $0xc0109861,(%esp)
c0100dc1:	e8 ef f4 ff ff       	call   c01002b5 <cprintf>
    for (i = 0; i < NCOMMANDS; i ++) {
c0100dc6:	ff 45 f4             	incl   -0xc(%ebp)
c0100dc9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100dcc:	83 f8 02             	cmp    $0x2,%eax
c0100dcf:	76 bb                	jbe    c0100d8c <mon_help+0x13>
    }
    return 0;
c0100dd1:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100dd6:	c9                   	leave  
c0100dd7:	c3                   	ret    

c0100dd8 <mon_kerninfo>:
/* *
 * mon_kerninfo - call print_kerninfo in kern/debug/kdebug.c to
 * print the memory occupancy in kernel.
 * */
int
mon_kerninfo(int argc, char **argv, struct trapframe *tf) {
c0100dd8:	f3 0f 1e fb          	endbr32 
c0100ddc:	55                   	push   %ebp
c0100ddd:	89 e5                	mov    %esp,%ebp
c0100ddf:	83 ec 08             	sub    $0x8,%esp
    print_kerninfo();
c0100de2:	e8 91 fb ff ff       	call   c0100978 <print_kerninfo>
    return 0;
c0100de7:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100dec:	c9                   	leave  
c0100ded:	c3                   	ret    

c0100dee <mon_backtrace>:
/* *
 * mon_backtrace - call print_stackframe in kern/debug/kdebug.c to
 * print a backtrace of the stack.
 * */
int
mon_backtrace(int argc, char **argv, struct trapframe *tf) {
c0100dee:	f3 0f 1e fb          	endbr32 
c0100df2:	55                   	push   %ebp
c0100df3:	89 e5                	mov    %esp,%ebp
c0100df5:	83 ec 08             	sub    $0x8,%esp
    print_stackframe();
c0100df8:	e8 cd fc ff ff       	call   c0100aca <print_stackframe>
    return 0;
c0100dfd:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100e02:	c9                   	leave  
c0100e03:	c3                   	ret    

c0100e04 <clock_init>:
/* *
 * clock_init - initialize 8253 clock to interrupt 100 times per second,
 * and then enable IRQ_TIMER.
 * */
void
clock_init(void) {
c0100e04:	f3 0f 1e fb          	endbr32 
c0100e08:	55                   	push   %ebp
c0100e09:	89 e5                	mov    %esp,%ebp
c0100e0b:	83 ec 28             	sub    $0x28,%esp
c0100e0e:	66 c7 45 ee 43 00    	movw   $0x43,-0x12(%ebp)
c0100e14:	c6 45 ed 34          	movb   $0x34,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100e18:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0100e1c:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0100e20:	ee                   	out    %al,(%dx)
}
c0100e21:	90                   	nop
c0100e22:	66 c7 45 f2 40 00    	movw   $0x40,-0xe(%ebp)
c0100e28:	c6 45 f1 9c          	movb   $0x9c,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100e2c:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0100e30:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0100e34:	ee                   	out    %al,(%dx)
}
c0100e35:	90                   	nop
c0100e36:	66 c7 45 f6 40 00    	movw   $0x40,-0xa(%ebp)
c0100e3c:	c6 45 f5 2e          	movb   $0x2e,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100e40:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0100e44:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c0100e48:	ee                   	out    %al,(%dx)
}
c0100e49:	90                   	nop
    outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
    outb(IO_TIMER1, TIMER_DIV(100) % 256);
    outb(IO_TIMER1, TIMER_DIV(100) / 256);

    // initialize time counter 'ticks' to zero
    ticks = 0;
c0100e4a:	c7 05 a0 6f 12 c0 00 	movl   $0x0,0xc0126fa0
c0100e51:	00 00 00 

    cprintf("++ setup timer interrupts\n");
c0100e54:	c7 04 24 6a 98 10 c0 	movl   $0xc010986a,(%esp)
c0100e5b:	e8 55 f4 ff ff       	call   c01002b5 <cprintf>
    pic_enable(IRQ_TIMER);
c0100e60:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c0100e67:	e8 95 09 00 00       	call   c0101801 <pic_enable>
}
c0100e6c:	90                   	nop
c0100e6d:	c9                   	leave  
c0100e6e:	c3                   	ret    

c0100e6f <__intr_save>:
#include <x86.h>
#include <intr.h>
#include <mmu.h>

static inline bool
__intr_save(void) {
c0100e6f:	55                   	push   %ebp
c0100e70:	89 e5                	mov    %esp,%ebp
c0100e72:	83 ec 18             	sub    $0x18,%esp
}

static inline uint32_t
read_eflags(void) {
    uint32_t eflags;
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0100e75:	9c                   	pushf  
c0100e76:	58                   	pop    %eax
c0100e77:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c0100e7a:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c0100e7d:	25 00 02 00 00       	and    $0x200,%eax
c0100e82:	85 c0                	test   %eax,%eax
c0100e84:	74 0c                	je     c0100e92 <__intr_save+0x23>
        intr_disable();
c0100e86:	e8 05 0b 00 00       	call   c0101990 <intr_disable>
        return 1;
c0100e8b:	b8 01 00 00 00       	mov    $0x1,%eax
c0100e90:	eb 05                	jmp    c0100e97 <__intr_save+0x28>
    }
    return 0;
c0100e92:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0100e97:	c9                   	leave  
c0100e98:	c3                   	ret    

c0100e99 <__intr_restore>:

static inline void
__intr_restore(bool flag) {
c0100e99:	55                   	push   %ebp
c0100e9a:	89 e5                	mov    %esp,%ebp
c0100e9c:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c0100e9f:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0100ea3:	74 05                	je     c0100eaa <__intr_restore+0x11>
        intr_enable();
c0100ea5:	e8 da 0a 00 00       	call   c0101984 <intr_enable>
    }
}
c0100eaa:	90                   	nop
c0100eab:	c9                   	leave  
c0100eac:	c3                   	ret    

c0100ead <delay>:
#include <memlayout.h>
#include <sync.h>

/* stupid I/O delay routine necessitated by historical PC design flaws */
static void
delay(void) {
c0100ead:	f3 0f 1e fb          	endbr32 
c0100eb1:	55                   	push   %ebp
c0100eb2:	89 e5                	mov    %esp,%ebp
c0100eb4:	83 ec 10             	sub    $0x10,%esp
c0100eb7:	66 c7 45 f2 84 00    	movw   $0x84,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100ebd:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0100ec1:	89 c2                	mov    %eax,%edx
c0100ec3:	ec                   	in     (%dx),%al
c0100ec4:	88 45 f1             	mov    %al,-0xf(%ebp)
c0100ec7:	66 c7 45 f6 84 00    	movw   $0x84,-0xa(%ebp)
c0100ecd:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c0100ed1:	89 c2                	mov    %eax,%edx
c0100ed3:	ec                   	in     (%dx),%al
c0100ed4:	88 45 f5             	mov    %al,-0xb(%ebp)
c0100ed7:	66 c7 45 fa 84 00    	movw   $0x84,-0x6(%ebp)
c0100edd:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0100ee1:	89 c2                	mov    %eax,%edx
c0100ee3:	ec                   	in     (%dx),%al
c0100ee4:	88 45 f9             	mov    %al,-0x7(%ebp)
c0100ee7:	66 c7 45 fe 84 00    	movw   $0x84,-0x2(%ebp)
c0100eed:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c0100ef1:	89 c2                	mov    %eax,%edx
c0100ef3:	ec                   	in     (%dx),%al
c0100ef4:	88 45 fd             	mov    %al,-0x3(%ebp)
    inb(0x84);
    inb(0x84);
    inb(0x84);
    inb(0x84);
}
c0100ef7:	90                   	nop
c0100ef8:	c9                   	leave  
c0100ef9:	c3                   	ret    

c0100efa <cga_init>:
static uint16_t addr_6845;

/* TEXT-mode CGA/VGA display output */

static void
cga_init(void) {
c0100efa:	f3 0f 1e fb          	endbr32 
c0100efe:	55                   	push   %ebp
c0100eff:	89 e5                	mov    %esp,%ebp
c0100f01:	83 ec 20             	sub    $0x20,%esp
    volatile uint16_t *cp = (uint16_t *)(CGA_BUF + KERNBASE);
c0100f04:	c7 45 fc 00 80 0b c0 	movl   $0xc00b8000,-0x4(%ebp)
    uint16_t was = *cp;
c0100f0b:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100f0e:	0f b7 00             	movzwl (%eax),%eax
c0100f11:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
    *cp = (uint16_t) 0xA55A;
c0100f15:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100f18:	66 c7 00 5a a5       	movw   $0xa55a,(%eax)
    if (*cp != 0xA55A) {
c0100f1d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100f20:	0f b7 00             	movzwl (%eax),%eax
c0100f23:	0f b7 c0             	movzwl %ax,%eax
c0100f26:	3d 5a a5 00 00       	cmp    $0xa55a,%eax
c0100f2b:	74 12                	je     c0100f3f <cga_init+0x45>
        cp = (uint16_t*)(MONO_BUF + KERNBASE);
c0100f2d:	c7 45 fc 00 00 0b c0 	movl   $0xc00b0000,-0x4(%ebp)
        addr_6845 = MONO_BASE;
c0100f34:	66 c7 05 46 64 12 c0 	movw   $0x3b4,0xc0126446
c0100f3b:	b4 03 
c0100f3d:	eb 13                	jmp    c0100f52 <cga_init+0x58>
    } else {
        *cp = was;
c0100f3f:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100f42:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c0100f46:	66 89 10             	mov    %dx,(%eax)
        addr_6845 = CGA_BASE;
c0100f49:	66 c7 05 46 64 12 c0 	movw   $0x3d4,0xc0126446
c0100f50:	d4 03 
    }

    // Extract cursor location
    uint32_t pos;
    outb(addr_6845, 14);
c0100f52:	0f b7 05 46 64 12 c0 	movzwl 0xc0126446,%eax
c0100f59:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c0100f5d:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100f61:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0100f65:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0100f69:	ee                   	out    %al,(%dx)
}
c0100f6a:	90                   	nop
    pos = inb(addr_6845 + 1) << 8;
c0100f6b:	0f b7 05 46 64 12 c0 	movzwl 0xc0126446,%eax
c0100f72:	40                   	inc    %eax
c0100f73:	0f b7 c0             	movzwl %ax,%eax
c0100f76:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100f7a:	0f b7 45 ea          	movzwl -0x16(%ebp),%eax
c0100f7e:	89 c2                	mov    %eax,%edx
c0100f80:	ec                   	in     (%dx),%al
c0100f81:	88 45 e9             	mov    %al,-0x17(%ebp)
    return data;
c0100f84:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0100f88:	0f b6 c0             	movzbl %al,%eax
c0100f8b:	c1 e0 08             	shl    $0x8,%eax
c0100f8e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    outb(addr_6845, 15);
c0100f91:	0f b7 05 46 64 12 c0 	movzwl 0xc0126446,%eax
c0100f98:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0100f9c:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100fa0:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0100fa4:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0100fa8:	ee                   	out    %al,(%dx)
}
c0100fa9:	90                   	nop
    pos |= inb(addr_6845 + 1);
c0100faa:	0f b7 05 46 64 12 c0 	movzwl 0xc0126446,%eax
c0100fb1:	40                   	inc    %eax
c0100fb2:	0f b7 c0             	movzwl %ax,%eax
c0100fb5:	66 89 45 f2          	mov    %ax,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0100fb9:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c0100fbd:	89 c2                	mov    %eax,%edx
c0100fbf:	ec                   	in     (%dx),%al
c0100fc0:	88 45 f1             	mov    %al,-0xf(%ebp)
    return data;
c0100fc3:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0100fc7:	0f b6 c0             	movzbl %al,%eax
c0100fca:	09 45 f4             	or     %eax,-0xc(%ebp)

    crt_buf = (uint16_t*) cp;
c0100fcd:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0100fd0:	a3 40 64 12 c0       	mov    %eax,0xc0126440
    crt_pos = pos;
c0100fd5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0100fd8:	0f b7 c0             	movzwl %ax,%eax
c0100fdb:	66 a3 44 64 12 c0    	mov    %ax,0xc0126444
}
c0100fe1:	90                   	nop
c0100fe2:	c9                   	leave  
c0100fe3:	c3                   	ret    

c0100fe4 <serial_init>:

static bool serial_exists = 0;

static void
serial_init(void) {
c0100fe4:	f3 0f 1e fb          	endbr32 
c0100fe8:	55                   	push   %ebp
c0100fe9:	89 e5                	mov    %esp,%ebp
c0100feb:	83 ec 48             	sub    $0x48,%esp
c0100fee:	66 c7 45 d2 fa 03    	movw   $0x3fa,-0x2e(%ebp)
c0100ff4:	c6 45 d1 00          	movb   $0x0,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0100ff8:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c0100ffc:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c0101000:	ee                   	out    %al,(%dx)
}
c0101001:	90                   	nop
c0101002:	66 c7 45 d6 fb 03    	movw   $0x3fb,-0x2a(%ebp)
c0101008:	c6 45 d5 80          	movb   $0x80,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010100c:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0101010:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c0101014:	ee                   	out    %al,(%dx)
}
c0101015:	90                   	nop
c0101016:	66 c7 45 da f8 03    	movw   $0x3f8,-0x26(%ebp)
c010101c:	c6 45 d9 0c          	movb   $0xc,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101020:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c0101024:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c0101028:	ee                   	out    %al,(%dx)
}
c0101029:	90                   	nop
c010102a:	66 c7 45 de f9 03    	movw   $0x3f9,-0x22(%ebp)
c0101030:	c6 45 dd 00          	movb   $0x0,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101034:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c0101038:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c010103c:	ee                   	out    %al,(%dx)
}
c010103d:	90                   	nop
c010103e:	66 c7 45 e2 fb 03    	movw   $0x3fb,-0x1e(%ebp)
c0101044:	c6 45 e1 03          	movb   $0x3,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101048:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c010104c:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c0101050:	ee                   	out    %al,(%dx)
}
c0101051:	90                   	nop
c0101052:	66 c7 45 e6 fc 03    	movw   $0x3fc,-0x1a(%ebp)
c0101058:	c6 45 e5 00          	movb   $0x0,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010105c:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101060:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101064:	ee                   	out    %al,(%dx)
}
c0101065:	90                   	nop
c0101066:	66 c7 45 ea f9 03    	movw   $0x3f9,-0x16(%ebp)
c010106c:	c6 45 e9 01          	movb   $0x1,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101070:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101074:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101078:	ee                   	out    %al,(%dx)
}
c0101079:	90                   	nop
c010107a:	66 c7 45 ee fd 03    	movw   $0x3fd,-0x12(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101080:	0f b7 45 ee          	movzwl -0x12(%ebp),%eax
c0101084:	89 c2                	mov    %eax,%edx
c0101086:	ec                   	in     (%dx),%al
c0101087:	88 45 ed             	mov    %al,-0x13(%ebp)
    return data;
c010108a:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
    // Enable rcv interrupts
    outb(COM1 + COM_IER, COM_IER_RDI);

    // Clear any preexisting overrun indications and interrupts
    // Serial port doesn't exist if COM_LSR returns 0xFF
    serial_exists = (inb(COM1 + COM_LSR) != 0xFF);
c010108e:	3c ff                	cmp    $0xff,%al
c0101090:	0f 95 c0             	setne  %al
c0101093:	0f b6 c0             	movzbl %al,%eax
c0101096:	a3 48 64 12 c0       	mov    %eax,0xc0126448
c010109b:	66 c7 45 f2 fa 03    	movw   $0x3fa,-0xe(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01010a1:	0f b7 45 f2          	movzwl -0xe(%ebp),%eax
c01010a5:	89 c2                	mov    %eax,%edx
c01010a7:	ec                   	in     (%dx),%al
c01010a8:	88 45 f1             	mov    %al,-0xf(%ebp)
c01010ab:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
c01010b1:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01010b5:	89 c2                	mov    %eax,%edx
c01010b7:	ec                   	in     (%dx),%al
c01010b8:	88 45 f5             	mov    %al,-0xb(%ebp)
    (void) inb(COM1+COM_IIR);
    (void) inb(COM1+COM_RX);

    if (serial_exists) {
c01010bb:	a1 48 64 12 c0       	mov    0xc0126448,%eax
c01010c0:	85 c0                	test   %eax,%eax
c01010c2:	74 0c                	je     c01010d0 <serial_init+0xec>
        pic_enable(IRQ_COM1);
c01010c4:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c01010cb:	e8 31 07 00 00       	call   c0101801 <pic_enable>
    }
}
c01010d0:	90                   	nop
c01010d1:	c9                   	leave  
c01010d2:	c3                   	ret    

c01010d3 <lpt_putc_sub>:

static void
lpt_putc_sub(int c) {
c01010d3:	f3 0f 1e fb          	endbr32 
c01010d7:	55                   	push   %ebp
c01010d8:	89 e5                	mov    %esp,%ebp
c01010da:	83 ec 20             	sub    $0x20,%esp
    int i;
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c01010dd:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c01010e4:	eb 08                	jmp    c01010ee <lpt_putc_sub+0x1b>
        delay();
c01010e6:	e8 c2 fd ff ff       	call   c0100ead <delay>
    for (i = 0; !(inb(LPTPORT + 1) & 0x80) && i < 12800; i ++) {
c01010eb:	ff 45 fc             	incl   -0x4(%ebp)
c01010ee:	66 c7 45 fa 79 03    	movw   $0x379,-0x6(%ebp)
c01010f4:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c01010f8:	89 c2                	mov    %eax,%edx
c01010fa:	ec                   	in     (%dx),%al
c01010fb:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c01010fe:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c0101102:	84 c0                	test   %al,%al
c0101104:	78 09                	js     c010110f <lpt_putc_sub+0x3c>
c0101106:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
c010110d:	7e d7                	jle    c01010e6 <lpt_putc_sub+0x13>
    }
    outb(LPTPORT + 0, c);
c010110f:	8b 45 08             	mov    0x8(%ebp),%eax
c0101112:	0f b6 c0             	movzbl %al,%eax
c0101115:	66 c7 45 ee 78 03    	movw   $0x378,-0x12(%ebp)
c010111b:	88 45 ed             	mov    %al,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010111e:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c0101122:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101126:	ee                   	out    %al,(%dx)
}
c0101127:	90                   	nop
c0101128:	66 c7 45 f2 7a 03    	movw   $0x37a,-0xe(%ebp)
c010112e:	c6 45 f1 0d          	movb   $0xd,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101132:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101136:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c010113a:	ee                   	out    %al,(%dx)
}
c010113b:	90                   	nop
c010113c:	66 c7 45 f6 7a 03    	movw   $0x37a,-0xa(%ebp)
c0101142:	c6 45 f5 08          	movb   $0x8,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101146:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c010114a:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c010114e:	ee                   	out    %al,(%dx)
}
c010114f:	90                   	nop
    outb(LPTPORT + 2, 0x08 | 0x04 | 0x01);
    outb(LPTPORT + 2, 0x08);
}
c0101150:	90                   	nop
c0101151:	c9                   	leave  
c0101152:	c3                   	ret    

c0101153 <lpt_putc>:

/* lpt_putc - copy console output to parallel port */
static void
lpt_putc(int c) {
c0101153:	f3 0f 1e fb          	endbr32 
c0101157:	55                   	push   %ebp
c0101158:	89 e5                	mov    %esp,%ebp
c010115a:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
c010115d:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c0101161:	74 0d                	je     c0101170 <lpt_putc+0x1d>
        lpt_putc_sub(c);
c0101163:	8b 45 08             	mov    0x8(%ebp),%eax
c0101166:	89 04 24             	mov    %eax,(%esp)
c0101169:	e8 65 ff ff ff       	call   c01010d3 <lpt_putc_sub>
    else {
        lpt_putc_sub('\b');
        lpt_putc_sub(' ');
        lpt_putc_sub('\b');
    }
}
c010116e:	eb 24                	jmp    c0101194 <lpt_putc+0x41>
        lpt_putc_sub('\b');
c0101170:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101177:	e8 57 ff ff ff       	call   c01010d3 <lpt_putc_sub>
        lpt_putc_sub(' ');
c010117c:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c0101183:	e8 4b ff ff ff       	call   c01010d3 <lpt_putc_sub>
        lpt_putc_sub('\b');
c0101188:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c010118f:	e8 3f ff ff ff       	call   c01010d3 <lpt_putc_sub>
}
c0101194:	90                   	nop
c0101195:	c9                   	leave  
c0101196:	c3                   	ret    

c0101197 <cga_putc>:

/* cga_putc - print character to console */
static void
cga_putc(int c) {
c0101197:	f3 0f 1e fb          	endbr32 
c010119b:	55                   	push   %ebp
c010119c:	89 e5                	mov    %esp,%ebp
c010119e:	53                   	push   %ebx
c010119f:	83 ec 34             	sub    $0x34,%esp
    // set black on white
    if (!(c & ~0xFF)) {
c01011a2:	8b 45 08             	mov    0x8(%ebp),%eax
c01011a5:	25 00 ff ff ff       	and    $0xffffff00,%eax
c01011aa:	85 c0                	test   %eax,%eax
c01011ac:	75 07                	jne    c01011b5 <cga_putc+0x1e>
        c |= 0x0700;
c01011ae:	81 4d 08 00 07 00 00 	orl    $0x700,0x8(%ebp)
    }

    switch (c & 0xff) {
c01011b5:	8b 45 08             	mov    0x8(%ebp),%eax
c01011b8:	0f b6 c0             	movzbl %al,%eax
c01011bb:	83 f8 0d             	cmp    $0xd,%eax
c01011be:	74 72                	je     c0101232 <cga_putc+0x9b>
c01011c0:	83 f8 0d             	cmp    $0xd,%eax
c01011c3:	0f 8f a3 00 00 00    	jg     c010126c <cga_putc+0xd5>
c01011c9:	83 f8 08             	cmp    $0x8,%eax
c01011cc:	74 0a                	je     c01011d8 <cga_putc+0x41>
c01011ce:	83 f8 0a             	cmp    $0xa,%eax
c01011d1:	74 4c                	je     c010121f <cga_putc+0x88>
c01011d3:	e9 94 00 00 00       	jmp    c010126c <cga_putc+0xd5>
    case '\b':
        if (crt_pos > 0) {
c01011d8:	0f b7 05 44 64 12 c0 	movzwl 0xc0126444,%eax
c01011df:	85 c0                	test   %eax,%eax
c01011e1:	0f 84 af 00 00 00    	je     c0101296 <cga_putc+0xff>
            crt_pos --;
c01011e7:	0f b7 05 44 64 12 c0 	movzwl 0xc0126444,%eax
c01011ee:	48                   	dec    %eax
c01011ef:	0f b7 c0             	movzwl %ax,%eax
c01011f2:	66 a3 44 64 12 c0    	mov    %ax,0xc0126444
            crt_buf[crt_pos] = (c & ~0xff) | ' ';
c01011f8:	8b 45 08             	mov    0x8(%ebp),%eax
c01011fb:	98                   	cwtl   
c01011fc:	25 00 ff ff ff       	and    $0xffffff00,%eax
c0101201:	98                   	cwtl   
c0101202:	83 c8 20             	or     $0x20,%eax
c0101205:	98                   	cwtl   
c0101206:	8b 15 40 64 12 c0    	mov    0xc0126440,%edx
c010120c:	0f b7 0d 44 64 12 c0 	movzwl 0xc0126444,%ecx
c0101213:	01 c9                	add    %ecx,%ecx
c0101215:	01 ca                	add    %ecx,%edx
c0101217:	0f b7 c0             	movzwl %ax,%eax
c010121a:	66 89 02             	mov    %ax,(%edx)
        }
        break;
c010121d:	eb 77                	jmp    c0101296 <cga_putc+0xff>
    case '\n':
        crt_pos += CRT_COLS;
c010121f:	0f b7 05 44 64 12 c0 	movzwl 0xc0126444,%eax
c0101226:	83 c0 50             	add    $0x50,%eax
c0101229:	0f b7 c0             	movzwl %ax,%eax
c010122c:	66 a3 44 64 12 c0    	mov    %ax,0xc0126444
    case '\r':
        crt_pos -= (crt_pos % CRT_COLS);
c0101232:	0f b7 1d 44 64 12 c0 	movzwl 0xc0126444,%ebx
c0101239:	0f b7 0d 44 64 12 c0 	movzwl 0xc0126444,%ecx
c0101240:	ba cd cc cc cc       	mov    $0xcccccccd,%edx
c0101245:	89 c8                	mov    %ecx,%eax
c0101247:	f7 e2                	mul    %edx
c0101249:	c1 ea 06             	shr    $0x6,%edx
c010124c:	89 d0                	mov    %edx,%eax
c010124e:	c1 e0 02             	shl    $0x2,%eax
c0101251:	01 d0                	add    %edx,%eax
c0101253:	c1 e0 04             	shl    $0x4,%eax
c0101256:	29 c1                	sub    %eax,%ecx
c0101258:	89 c8                	mov    %ecx,%eax
c010125a:	0f b7 c0             	movzwl %ax,%eax
c010125d:	29 c3                	sub    %eax,%ebx
c010125f:	89 d8                	mov    %ebx,%eax
c0101261:	0f b7 c0             	movzwl %ax,%eax
c0101264:	66 a3 44 64 12 c0    	mov    %ax,0xc0126444
        break;
c010126a:	eb 2b                	jmp    c0101297 <cga_putc+0x100>
    default:
        crt_buf[crt_pos ++] = c;     // write the character
c010126c:	8b 0d 40 64 12 c0    	mov    0xc0126440,%ecx
c0101272:	0f b7 05 44 64 12 c0 	movzwl 0xc0126444,%eax
c0101279:	8d 50 01             	lea    0x1(%eax),%edx
c010127c:	0f b7 d2             	movzwl %dx,%edx
c010127f:	66 89 15 44 64 12 c0 	mov    %dx,0xc0126444
c0101286:	01 c0                	add    %eax,%eax
c0101288:	8d 14 01             	lea    (%ecx,%eax,1),%edx
c010128b:	8b 45 08             	mov    0x8(%ebp),%eax
c010128e:	0f b7 c0             	movzwl %ax,%eax
c0101291:	66 89 02             	mov    %ax,(%edx)
        break;
c0101294:	eb 01                	jmp    c0101297 <cga_putc+0x100>
        break;
c0101296:	90                   	nop
    }

    // What is the purpose of this?
    if (crt_pos >= CRT_SIZE) {
c0101297:	0f b7 05 44 64 12 c0 	movzwl 0xc0126444,%eax
c010129e:	3d cf 07 00 00       	cmp    $0x7cf,%eax
c01012a3:	76 5d                	jbe    c0101302 <cga_putc+0x16b>
        int i;
        memmove(crt_buf, crt_buf + CRT_COLS, (CRT_SIZE - CRT_COLS) * sizeof(uint16_t));
c01012a5:	a1 40 64 12 c0       	mov    0xc0126440,%eax
c01012aa:	8d 90 a0 00 00 00    	lea    0xa0(%eax),%edx
c01012b0:	a1 40 64 12 c0       	mov    0xc0126440,%eax
c01012b5:	c7 44 24 08 00 0f 00 	movl   $0xf00,0x8(%esp)
c01012bc:	00 
c01012bd:	89 54 24 04          	mov    %edx,0x4(%esp)
c01012c1:	89 04 24             	mov    %eax,(%esp)
c01012c4:	e8 58 7a 00 00       	call   c0108d21 <memmove>
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c01012c9:	c7 45 f4 80 07 00 00 	movl   $0x780,-0xc(%ebp)
c01012d0:	eb 14                	jmp    c01012e6 <cga_putc+0x14f>
            crt_buf[i] = 0x0700 | ' ';
c01012d2:	a1 40 64 12 c0       	mov    0xc0126440,%eax
c01012d7:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01012da:	01 d2                	add    %edx,%edx
c01012dc:	01 d0                	add    %edx,%eax
c01012de:	66 c7 00 20 07       	movw   $0x720,(%eax)
        for (i = CRT_SIZE - CRT_COLS; i < CRT_SIZE; i ++) {
c01012e3:	ff 45 f4             	incl   -0xc(%ebp)
c01012e6:	81 7d f4 cf 07 00 00 	cmpl   $0x7cf,-0xc(%ebp)
c01012ed:	7e e3                	jle    c01012d2 <cga_putc+0x13b>
        }
        crt_pos -= CRT_COLS;
c01012ef:	0f b7 05 44 64 12 c0 	movzwl 0xc0126444,%eax
c01012f6:	83 e8 50             	sub    $0x50,%eax
c01012f9:	0f b7 c0             	movzwl %ax,%eax
c01012fc:	66 a3 44 64 12 c0    	mov    %ax,0xc0126444
    }

    // move that little blinky thing
    outb(addr_6845, 14);
c0101302:	0f b7 05 46 64 12 c0 	movzwl 0xc0126446,%eax
c0101309:	66 89 45 e6          	mov    %ax,-0x1a(%ebp)
c010130d:	c6 45 e5 0e          	movb   $0xe,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101311:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c0101315:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c0101319:	ee                   	out    %al,(%dx)
}
c010131a:	90                   	nop
    outb(addr_6845 + 1, crt_pos >> 8);
c010131b:	0f b7 05 44 64 12 c0 	movzwl 0xc0126444,%eax
c0101322:	c1 e8 08             	shr    $0x8,%eax
c0101325:	0f b7 c0             	movzwl %ax,%eax
c0101328:	0f b6 c0             	movzbl %al,%eax
c010132b:	0f b7 15 46 64 12 c0 	movzwl 0xc0126446,%edx
c0101332:	42                   	inc    %edx
c0101333:	0f b7 d2             	movzwl %dx,%edx
c0101336:	66 89 55 ea          	mov    %dx,-0x16(%ebp)
c010133a:	88 45 e9             	mov    %al,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010133d:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c0101341:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c0101345:	ee                   	out    %al,(%dx)
}
c0101346:	90                   	nop
    outb(addr_6845, 15);
c0101347:	0f b7 05 46 64 12 c0 	movzwl 0xc0126446,%eax
c010134e:	66 89 45 ee          	mov    %ax,-0x12(%ebp)
c0101352:	c6 45 ed 0f          	movb   $0xf,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101356:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c010135a:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c010135e:	ee                   	out    %al,(%dx)
}
c010135f:	90                   	nop
    outb(addr_6845 + 1, crt_pos);
c0101360:	0f b7 05 44 64 12 c0 	movzwl 0xc0126444,%eax
c0101367:	0f b6 c0             	movzbl %al,%eax
c010136a:	0f b7 15 46 64 12 c0 	movzwl 0xc0126446,%edx
c0101371:	42                   	inc    %edx
c0101372:	0f b7 d2             	movzwl %dx,%edx
c0101375:	66 89 55 f2          	mov    %dx,-0xe(%ebp)
c0101379:	88 45 f1             	mov    %al,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010137c:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101380:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101384:	ee                   	out    %al,(%dx)
}
c0101385:	90                   	nop
}
c0101386:	90                   	nop
c0101387:	83 c4 34             	add    $0x34,%esp
c010138a:	5b                   	pop    %ebx
c010138b:	5d                   	pop    %ebp
c010138c:	c3                   	ret    

c010138d <serial_putc_sub>:

static void
serial_putc_sub(int c) {
c010138d:	f3 0f 1e fb          	endbr32 
c0101391:	55                   	push   %ebp
c0101392:	89 e5                	mov    %esp,%ebp
c0101394:	83 ec 10             	sub    $0x10,%esp
    int i;
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c0101397:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c010139e:	eb 08                	jmp    c01013a8 <serial_putc_sub+0x1b>
        delay();
c01013a0:	e8 08 fb ff ff       	call   c0100ead <delay>
    for (i = 0; !(inb(COM1 + COM_LSR) & COM_LSR_TXRDY) && i < 12800; i ++) {
c01013a5:	ff 45 fc             	incl   -0x4(%ebp)
c01013a8:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01013ae:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c01013b2:	89 c2                	mov    %eax,%edx
c01013b4:	ec                   	in     (%dx),%al
c01013b5:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c01013b8:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01013bc:	0f b6 c0             	movzbl %al,%eax
c01013bf:	83 e0 20             	and    $0x20,%eax
c01013c2:	85 c0                	test   %eax,%eax
c01013c4:	75 09                	jne    c01013cf <serial_putc_sub+0x42>
c01013c6:	81 7d fc ff 31 00 00 	cmpl   $0x31ff,-0x4(%ebp)
c01013cd:	7e d1                	jle    c01013a0 <serial_putc_sub+0x13>
    }
    outb(COM1 + COM_TX, c);
c01013cf:	8b 45 08             	mov    0x8(%ebp),%eax
c01013d2:	0f b6 c0             	movzbl %al,%eax
c01013d5:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
c01013db:	88 45 f5             	mov    %al,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01013de:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c01013e2:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c01013e6:	ee                   	out    %al,(%dx)
}
c01013e7:	90                   	nop
}
c01013e8:	90                   	nop
c01013e9:	c9                   	leave  
c01013ea:	c3                   	ret    

c01013eb <serial_putc>:

/* serial_putc - print character to serial port */
static void
serial_putc(int c) {
c01013eb:	f3 0f 1e fb          	endbr32 
c01013ef:	55                   	push   %ebp
c01013f0:	89 e5                	mov    %esp,%ebp
c01013f2:	83 ec 04             	sub    $0x4,%esp
    if (c != '\b') {
c01013f5:	83 7d 08 08          	cmpl   $0x8,0x8(%ebp)
c01013f9:	74 0d                	je     c0101408 <serial_putc+0x1d>
        serial_putc_sub(c);
c01013fb:	8b 45 08             	mov    0x8(%ebp),%eax
c01013fe:	89 04 24             	mov    %eax,(%esp)
c0101401:	e8 87 ff ff ff       	call   c010138d <serial_putc_sub>
    else {
        serial_putc_sub('\b');
        serial_putc_sub(' ');
        serial_putc_sub('\b');
    }
}
c0101406:	eb 24                	jmp    c010142c <serial_putc+0x41>
        serial_putc_sub('\b');
c0101408:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c010140f:	e8 79 ff ff ff       	call   c010138d <serial_putc_sub>
        serial_putc_sub(' ');
c0101414:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c010141b:	e8 6d ff ff ff       	call   c010138d <serial_putc_sub>
        serial_putc_sub('\b');
c0101420:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
c0101427:	e8 61 ff ff ff       	call   c010138d <serial_putc_sub>
}
c010142c:	90                   	nop
c010142d:	c9                   	leave  
c010142e:	c3                   	ret    

c010142f <cons_intr>:
/* *
 * cons_intr - called by device interrupt routines to feed input
 * characters into the circular console input buffer.
 * */
static void
cons_intr(int (*proc)(void)) {
c010142f:	f3 0f 1e fb          	endbr32 
c0101433:	55                   	push   %ebp
c0101434:	89 e5                	mov    %esp,%ebp
c0101436:	83 ec 18             	sub    $0x18,%esp
    int c;
    while ((c = (*proc)()) != -1) {
c0101439:	eb 33                	jmp    c010146e <cons_intr+0x3f>
        if (c != 0) {
c010143b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010143f:	74 2d                	je     c010146e <cons_intr+0x3f>
            cons.buf[cons.wpos ++] = c;
c0101441:	a1 64 66 12 c0       	mov    0xc0126664,%eax
c0101446:	8d 50 01             	lea    0x1(%eax),%edx
c0101449:	89 15 64 66 12 c0    	mov    %edx,0xc0126664
c010144f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0101452:	88 90 60 64 12 c0    	mov    %dl,-0x3fed9ba0(%eax)
            if (cons.wpos == CONSBUFSIZE) {
c0101458:	a1 64 66 12 c0       	mov    0xc0126664,%eax
c010145d:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101462:	75 0a                	jne    c010146e <cons_intr+0x3f>
                cons.wpos = 0;
c0101464:	c7 05 64 66 12 c0 00 	movl   $0x0,0xc0126664
c010146b:	00 00 00 
    while ((c = (*proc)()) != -1) {
c010146e:	8b 45 08             	mov    0x8(%ebp),%eax
c0101471:	ff d0                	call   *%eax
c0101473:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0101476:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
c010147a:	75 bf                	jne    c010143b <cons_intr+0xc>
            }
        }
    }
}
c010147c:	90                   	nop
c010147d:	90                   	nop
c010147e:	c9                   	leave  
c010147f:	c3                   	ret    

c0101480 <serial_proc_data>:

/* serial_proc_data - get data from serial port */
static int
serial_proc_data(void) {
c0101480:	f3 0f 1e fb          	endbr32 
c0101484:	55                   	push   %ebp
c0101485:	89 e5                	mov    %esp,%ebp
c0101487:	83 ec 10             	sub    $0x10,%esp
c010148a:	66 c7 45 fa fd 03    	movw   $0x3fd,-0x6(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101490:	0f b7 45 fa          	movzwl -0x6(%ebp),%eax
c0101494:	89 c2                	mov    %eax,%edx
c0101496:	ec                   	in     (%dx),%al
c0101497:	88 45 f9             	mov    %al,-0x7(%ebp)
    return data;
c010149a:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
    if (!(inb(COM1 + COM_LSR) & COM_LSR_DATA)) {
c010149e:	0f b6 c0             	movzbl %al,%eax
c01014a1:	83 e0 01             	and    $0x1,%eax
c01014a4:	85 c0                	test   %eax,%eax
c01014a6:	75 07                	jne    c01014af <serial_proc_data+0x2f>
        return -1;
c01014a8:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c01014ad:	eb 2a                	jmp    c01014d9 <serial_proc_data+0x59>
c01014af:	66 c7 45 f6 f8 03    	movw   $0x3f8,-0xa(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c01014b5:	0f b7 45 f6          	movzwl -0xa(%ebp),%eax
c01014b9:	89 c2                	mov    %eax,%edx
c01014bb:	ec                   	in     (%dx),%al
c01014bc:	88 45 f5             	mov    %al,-0xb(%ebp)
    return data;
c01014bf:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
    }
    int c = inb(COM1 + COM_RX);
c01014c3:	0f b6 c0             	movzbl %al,%eax
c01014c6:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (c == 127) {
c01014c9:	83 7d fc 7f          	cmpl   $0x7f,-0x4(%ebp)
c01014cd:	75 07                	jne    c01014d6 <serial_proc_data+0x56>
        c = '\b';
c01014cf:	c7 45 fc 08 00 00 00 	movl   $0x8,-0x4(%ebp)
    }
    return c;
c01014d6:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01014d9:	c9                   	leave  
c01014da:	c3                   	ret    

c01014db <serial_intr>:

/* serial_intr - try to feed input characters from serial port */
void
serial_intr(void) {
c01014db:	f3 0f 1e fb          	endbr32 
c01014df:	55                   	push   %ebp
c01014e0:	89 e5                	mov    %esp,%ebp
c01014e2:	83 ec 18             	sub    $0x18,%esp
    if (serial_exists) {
c01014e5:	a1 48 64 12 c0       	mov    0xc0126448,%eax
c01014ea:	85 c0                	test   %eax,%eax
c01014ec:	74 0c                	je     c01014fa <serial_intr+0x1f>
        cons_intr(serial_proc_data);
c01014ee:	c7 04 24 80 14 10 c0 	movl   $0xc0101480,(%esp)
c01014f5:	e8 35 ff ff ff       	call   c010142f <cons_intr>
    }
}
c01014fa:	90                   	nop
c01014fb:	c9                   	leave  
c01014fc:	c3                   	ret    

c01014fd <kbd_proc_data>:
 *
 * The kbd_proc_data() function gets data from the keyboard.
 * If we finish a character, return it, else 0. And return -1 if no data.
 * */
static int
kbd_proc_data(void) {
c01014fd:	f3 0f 1e fb          	endbr32 
c0101501:	55                   	push   %ebp
c0101502:	89 e5                	mov    %esp,%ebp
c0101504:	83 ec 38             	sub    $0x38,%esp
c0101507:	66 c7 45 f0 64 00    	movw   $0x64,-0x10(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c010150d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101510:	89 c2                	mov    %eax,%edx
c0101512:	ec                   	in     (%dx),%al
c0101513:	88 45 ef             	mov    %al,-0x11(%ebp)
    return data;
c0101516:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
    int c;
    uint8_t data;
    static uint32_t shift;

    if ((inb(KBSTATP) & KBS_DIB) == 0) {
c010151a:	0f b6 c0             	movzbl %al,%eax
c010151d:	83 e0 01             	and    $0x1,%eax
c0101520:	85 c0                	test   %eax,%eax
c0101522:	75 0a                	jne    c010152e <kbd_proc_data+0x31>
        return -1;
c0101524:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0101529:	e9 56 01 00 00       	jmp    c0101684 <kbd_proc_data+0x187>
c010152e:	66 c7 45 ec 60 00    	movw   $0x60,-0x14(%ebp)
    asm volatile ("inb %1, %0" : "=a" (data) : "d" (port) : "memory");
c0101534:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0101537:	89 c2                	mov    %eax,%edx
c0101539:	ec                   	in     (%dx),%al
c010153a:	88 45 eb             	mov    %al,-0x15(%ebp)
    return data;
c010153d:	0f b6 45 eb          	movzbl -0x15(%ebp),%eax
    }

    data = inb(KBDATAP);
c0101541:	88 45 f3             	mov    %al,-0xd(%ebp)

    if (data == 0xE0) {
c0101544:	80 7d f3 e0          	cmpb   $0xe0,-0xd(%ebp)
c0101548:	75 17                	jne    c0101561 <kbd_proc_data+0x64>
        // E0 escape character
        shift |= E0ESC;
c010154a:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c010154f:	83 c8 40             	or     $0x40,%eax
c0101552:	a3 68 66 12 c0       	mov    %eax,0xc0126668
        return 0;
c0101557:	b8 00 00 00 00       	mov    $0x0,%eax
c010155c:	e9 23 01 00 00       	jmp    c0101684 <kbd_proc_data+0x187>
    } else if (data & 0x80) {
c0101561:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101565:	84 c0                	test   %al,%al
c0101567:	79 45                	jns    c01015ae <kbd_proc_data+0xb1>
        // Key released
        data = (shift & E0ESC ? data : data & 0x7F);
c0101569:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c010156e:	83 e0 40             	and    $0x40,%eax
c0101571:	85 c0                	test   %eax,%eax
c0101573:	75 08                	jne    c010157d <kbd_proc_data+0x80>
c0101575:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101579:	24 7f                	and    $0x7f,%al
c010157b:	eb 04                	jmp    c0101581 <kbd_proc_data+0x84>
c010157d:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101581:	88 45 f3             	mov    %al,-0xd(%ebp)
        shift &= ~(shiftcode[data] | E0ESC);
c0101584:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101588:	0f b6 80 40 30 12 c0 	movzbl -0x3fedcfc0(%eax),%eax
c010158f:	0c 40                	or     $0x40,%al
c0101591:	0f b6 c0             	movzbl %al,%eax
c0101594:	f7 d0                	not    %eax
c0101596:	89 c2                	mov    %eax,%edx
c0101598:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c010159d:	21 d0                	and    %edx,%eax
c010159f:	a3 68 66 12 c0       	mov    %eax,0xc0126668
        return 0;
c01015a4:	b8 00 00 00 00       	mov    $0x0,%eax
c01015a9:	e9 d6 00 00 00       	jmp    c0101684 <kbd_proc_data+0x187>
    } else if (shift & E0ESC) {
c01015ae:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c01015b3:	83 e0 40             	and    $0x40,%eax
c01015b6:	85 c0                	test   %eax,%eax
c01015b8:	74 11                	je     c01015cb <kbd_proc_data+0xce>
        // Last character was an E0 escape; or with 0x80
        data |= 0x80;
c01015ba:	80 4d f3 80          	orb    $0x80,-0xd(%ebp)
        shift &= ~E0ESC;
c01015be:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c01015c3:	83 e0 bf             	and    $0xffffffbf,%eax
c01015c6:	a3 68 66 12 c0       	mov    %eax,0xc0126668
    }

    shift |= shiftcode[data];
c01015cb:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c01015cf:	0f b6 80 40 30 12 c0 	movzbl -0x3fedcfc0(%eax),%eax
c01015d6:	0f b6 d0             	movzbl %al,%edx
c01015d9:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c01015de:	09 d0                	or     %edx,%eax
c01015e0:	a3 68 66 12 c0       	mov    %eax,0xc0126668
    shift ^= togglecode[data];
c01015e5:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c01015e9:	0f b6 80 40 31 12 c0 	movzbl -0x3fedcec0(%eax),%eax
c01015f0:	0f b6 d0             	movzbl %al,%edx
c01015f3:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c01015f8:	31 d0                	xor    %edx,%eax
c01015fa:	a3 68 66 12 c0       	mov    %eax,0xc0126668

    c = charcode[shift & (CTL | SHIFT)][data];
c01015ff:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c0101604:	83 e0 03             	and    $0x3,%eax
c0101607:	8b 14 85 40 35 12 c0 	mov    -0x3fedcac0(,%eax,4),%edx
c010160e:	0f b6 45 f3          	movzbl -0xd(%ebp),%eax
c0101612:	01 d0                	add    %edx,%eax
c0101614:	0f b6 00             	movzbl (%eax),%eax
c0101617:	0f b6 c0             	movzbl %al,%eax
c010161a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (shift & CAPSLOCK) {
c010161d:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c0101622:	83 e0 08             	and    $0x8,%eax
c0101625:	85 c0                	test   %eax,%eax
c0101627:	74 22                	je     c010164b <kbd_proc_data+0x14e>
        if ('a' <= c && c <= 'z')
c0101629:	83 7d f4 60          	cmpl   $0x60,-0xc(%ebp)
c010162d:	7e 0c                	jle    c010163b <kbd_proc_data+0x13e>
c010162f:	83 7d f4 7a          	cmpl   $0x7a,-0xc(%ebp)
c0101633:	7f 06                	jg     c010163b <kbd_proc_data+0x13e>
            c += 'A' - 'a';
c0101635:	83 6d f4 20          	subl   $0x20,-0xc(%ebp)
c0101639:	eb 10                	jmp    c010164b <kbd_proc_data+0x14e>
        else if ('A' <= c && c <= 'Z')
c010163b:	83 7d f4 40          	cmpl   $0x40,-0xc(%ebp)
c010163f:	7e 0a                	jle    c010164b <kbd_proc_data+0x14e>
c0101641:	83 7d f4 5a          	cmpl   $0x5a,-0xc(%ebp)
c0101645:	7f 04                	jg     c010164b <kbd_proc_data+0x14e>
            c += 'a' - 'A';
c0101647:	83 45 f4 20          	addl   $0x20,-0xc(%ebp)
    }

    // Process special keys
    // Ctrl-Alt-Del: reboot
    if (!(~shift & (CTL | ALT)) && c == KEY_DEL) {
c010164b:	a1 68 66 12 c0       	mov    0xc0126668,%eax
c0101650:	f7 d0                	not    %eax
c0101652:	83 e0 06             	and    $0x6,%eax
c0101655:	85 c0                	test   %eax,%eax
c0101657:	75 28                	jne    c0101681 <kbd_proc_data+0x184>
c0101659:	81 7d f4 e9 00 00 00 	cmpl   $0xe9,-0xc(%ebp)
c0101660:	75 1f                	jne    c0101681 <kbd_proc_data+0x184>
        cprintf("Rebooting!\n");
c0101662:	c7 04 24 85 98 10 c0 	movl   $0xc0109885,(%esp)
c0101669:	e8 47 ec ff ff       	call   c01002b5 <cprintf>
c010166e:	66 c7 45 e8 92 00    	movw   $0x92,-0x18(%ebp)
c0101674:	c6 45 e7 03          	movb   $0x3,-0x19(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101678:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
c010167c:	8b 55 e8             	mov    -0x18(%ebp),%edx
c010167f:	ee                   	out    %al,(%dx)
}
c0101680:	90                   	nop
        outb(0x92, 0x3); // courtesy of Chris Frost
    }
    return c;
c0101681:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0101684:	c9                   	leave  
c0101685:	c3                   	ret    

c0101686 <kbd_intr>:

/* kbd_intr - try to feed input characters from keyboard */
static void
kbd_intr(void) {
c0101686:	f3 0f 1e fb          	endbr32 
c010168a:	55                   	push   %ebp
c010168b:	89 e5                	mov    %esp,%ebp
c010168d:	83 ec 18             	sub    $0x18,%esp
    cons_intr(kbd_proc_data);
c0101690:	c7 04 24 fd 14 10 c0 	movl   $0xc01014fd,(%esp)
c0101697:	e8 93 fd ff ff       	call   c010142f <cons_intr>
}
c010169c:	90                   	nop
c010169d:	c9                   	leave  
c010169e:	c3                   	ret    

c010169f <kbd_init>:

static void
kbd_init(void) {
c010169f:	f3 0f 1e fb          	endbr32 
c01016a3:	55                   	push   %ebp
c01016a4:	89 e5                	mov    %esp,%ebp
c01016a6:	83 ec 18             	sub    $0x18,%esp
    // drain the kbd buffer
    kbd_intr();
c01016a9:	e8 d8 ff ff ff       	call   c0101686 <kbd_intr>
    pic_enable(IRQ_KBD);
c01016ae:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01016b5:	e8 47 01 00 00       	call   c0101801 <pic_enable>
}
c01016ba:	90                   	nop
c01016bb:	c9                   	leave  
c01016bc:	c3                   	ret    

c01016bd <cons_init>:

/* cons_init - initializes the console devices */
void
cons_init(void) {
c01016bd:	f3 0f 1e fb          	endbr32 
c01016c1:	55                   	push   %ebp
c01016c2:	89 e5                	mov    %esp,%ebp
c01016c4:	83 ec 18             	sub    $0x18,%esp
    cga_init();
c01016c7:	e8 2e f8 ff ff       	call   c0100efa <cga_init>
    serial_init();
c01016cc:	e8 13 f9 ff ff       	call   c0100fe4 <serial_init>
    kbd_init();
c01016d1:	e8 c9 ff ff ff       	call   c010169f <kbd_init>
    if (!serial_exists) {
c01016d6:	a1 48 64 12 c0       	mov    0xc0126448,%eax
c01016db:	85 c0                	test   %eax,%eax
c01016dd:	75 0c                	jne    c01016eb <cons_init+0x2e>
        cprintf("serial port does not exist!!\n");
c01016df:	c7 04 24 91 98 10 c0 	movl   $0xc0109891,(%esp)
c01016e6:	e8 ca eb ff ff       	call   c01002b5 <cprintf>
    }
}
c01016eb:	90                   	nop
c01016ec:	c9                   	leave  
c01016ed:	c3                   	ret    

c01016ee <cons_putc>:

/* cons_putc - print a single character @c to console devices */
void
cons_putc(int c) {
c01016ee:	f3 0f 1e fb          	endbr32 
c01016f2:	55                   	push   %ebp
c01016f3:	89 e5                	mov    %esp,%ebp
c01016f5:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c01016f8:	e8 72 f7 ff ff       	call   c0100e6f <__intr_save>
c01016fd:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        lpt_putc(c);
c0101700:	8b 45 08             	mov    0x8(%ebp),%eax
c0101703:	89 04 24             	mov    %eax,(%esp)
c0101706:	e8 48 fa ff ff       	call   c0101153 <lpt_putc>
        cga_putc(c);
c010170b:	8b 45 08             	mov    0x8(%ebp),%eax
c010170e:	89 04 24             	mov    %eax,(%esp)
c0101711:	e8 81 fa ff ff       	call   c0101197 <cga_putc>
        serial_putc(c);
c0101716:	8b 45 08             	mov    0x8(%ebp),%eax
c0101719:	89 04 24             	mov    %eax,(%esp)
c010171c:	e8 ca fc ff ff       	call   c01013eb <serial_putc>
    }
    local_intr_restore(intr_flag);
c0101721:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101724:	89 04 24             	mov    %eax,(%esp)
c0101727:	e8 6d f7 ff ff       	call   c0100e99 <__intr_restore>
}
c010172c:	90                   	nop
c010172d:	c9                   	leave  
c010172e:	c3                   	ret    

c010172f <cons_getc>:
/* *
 * cons_getc - return the next input character from console,
 * or 0 if none waiting.
 * */
int
cons_getc(void) {
c010172f:	f3 0f 1e fb          	endbr32 
c0101733:	55                   	push   %ebp
c0101734:	89 e5                	mov    %esp,%ebp
c0101736:	83 ec 28             	sub    $0x28,%esp
    int c = 0;
c0101739:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
c0101740:	e8 2a f7 ff ff       	call   c0100e6f <__intr_save>
c0101745:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        // poll for any pending input characters,
        // so that this function works even when interrupts are disabled
        // (e.g., when called from the kernel monitor).
        serial_intr();
c0101748:	e8 8e fd ff ff       	call   c01014db <serial_intr>
        kbd_intr();
c010174d:	e8 34 ff ff ff       	call   c0101686 <kbd_intr>

        // grab the next character from the input buffer.
        if (cons.rpos != cons.wpos) {
c0101752:	8b 15 60 66 12 c0    	mov    0xc0126660,%edx
c0101758:	a1 64 66 12 c0       	mov    0xc0126664,%eax
c010175d:	39 c2                	cmp    %eax,%edx
c010175f:	74 31                	je     c0101792 <cons_getc+0x63>
            c = cons.buf[cons.rpos ++];
c0101761:	a1 60 66 12 c0       	mov    0xc0126660,%eax
c0101766:	8d 50 01             	lea    0x1(%eax),%edx
c0101769:	89 15 60 66 12 c0    	mov    %edx,0xc0126660
c010176f:	0f b6 80 60 64 12 c0 	movzbl -0x3fed9ba0(%eax),%eax
c0101776:	0f b6 c0             	movzbl %al,%eax
c0101779:	89 45 f4             	mov    %eax,-0xc(%ebp)
            if (cons.rpos == CONSBUFSIZE) {
c010177c:	a1 60 66 12 c0       	mov    0xc0126660,%eax
c0101781:	3d 00 02 00 00       	cmp    $0x200,%eax
c0101786:	75 0a                	jne    c0101792 <cons_getc+0x63>
                cons.rpos = 0;
c0101788:	c7 05 60 66 12 c0 00 	movl   $0x0,0xc0126660
c010178f:	00 00 00 
            }
        }
    }
    local_intr_restore(intr_flag);
c0101792:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101795:	89 04 24             	mov    %eax,(%esp)
c0101798:	e8 fc f6 ff ff       	call   c0100e99 <__intr_restore>
    return c;
c010179d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c01017a0:	c9                   	leave  
c01017a1:	c3                   	ret    

c01017a2 <pic_setmask>:
// Initial IRQ mask has interrupt 2 enabled (for slave 8259A).
static uint16_t irq_mask = 0xFFFF & ~(1 << IRQ_SLAVE);
static bool did_init = 0;

static void
pic_setmask(uint16_t mask) {
c01017a2:	f3 0f 1e fb          	endbr32 
c01017a6:	55                   	push   %ebp
c01017a7:	89 e5                	mov    %esp,%ebp
c01017a9:	83 ec 14             	sub    $0x14,%esp
c01017ac:	8b 45 08             	mov    0x8(%ebp),%eax
c01017af:	66 89 45 ec          	mov    %ax,-0x14(%ebp)
    irq_mask = mask;
c01017b3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01017b6:	66 a3 50 35 12 c0    	mov    %ax,0xc0123550
    if (did_init) {
c01017bc:	a1 6c 66 12 c0       	mov    0xc012666c,%eax
c01017c1:	85 c0                	test   %eax,%eax
c01017c3:	74 39                	je     c01017fe <pic_setmask+0x5c>
        outb(IO_PIC1 + 1, mask);
c01017c5:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01017c8:	0f b6 c0             	movzbl %al,%eax
c01017cb:	66 c7 45 fa 21 00    	movw   $0x21,-0x6(%ebp)
c01017d1:	88 45 f9             	mov    %al,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017d4:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c01017d8:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c01017dc:	ee                   	out    %al,(%dx)
}
c01017dd:	90                   	nop
        outb(IO_PIC2 + 1, mask >> 8);
c01017de:	0f b7 45 ec          	movzwl -0x14(%ebp),%eax
c01017e2:	c1 e8 08             	shr    $0x8,%eax
c01017e5:	0f b7 c0             	movzwl %ax,%eax
c01017e8:	0f b6 c0             	movzbl %al,%eax
c01017eb:	66 c7 45 fe a1 00    	movw   $0xa1,-0x2(%ebp)
c01017f1:	88 45 fd             	mov    %al,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01017f4:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c01017f8:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c01017fc:	ee                   	out    %al,(%dx)
}
c01017fd:	90                   	nop
    }
}
c01017fe:	90                   	nop
c01017ff:	c9                   	leave  
c0101800:	c3                   	ret    

c0101801 <pic_enable>:

void
pic_enable(unsigned int irq) {
c0101801:	f3 0f 1e fb          	endbr32 
c0101805:	55                   	push   %ebp
c0101806:	89 e5                	mov    %esp,%ebp
c0101808:	83 ec 04             	sub    $0x4,%esp
    pic_setmask(irq_mask & ~(1 << irq));
c010180b:	8b 45 08             	mov    0x8(%ebp),%eax
c010180e:	ba 01 00 00 00       	mov    $0x1,%edx
c0101813:	88 c1                	mov    %al,%cl
c0101815:	d3 e2                	shl    %cl,%edx
c0101817:	89 d0                	mov    %edx,%eax
c0101819:	98                   	cwtl   
c010181a:	f7 d0                	not    %eax
c010181c:	0f bf d0             	movswl %ax,%edx
c010181f:	0f b7 05 50 35 12 c0 	movzwl 0xc0123550,%eax
c0101826:	98                   	cwtl   
c0101827:	21 d0                	and    %edx,%eax
c0101829:	98                   	cwtl   
c010182a:	0f b7 c0             	movzwl %ax,%eax
c010182d:	89 04 24             	mov    %eax,(%esp)
c0101830:	e8 6d ff ff ff       	call   c01017a2 <pic_setmask>
}
c0101835:	90                   	nop
c0101836:	c9                   	leave  
c0101837:	c3                   	ret    

c0101838 <pic_init>:

/* pic_init - initialize the 8259A interrupt controllers */
void
pic_init(void) {
c0101838:	f3 0f 1e fb          	endbr32 
c010183c:	55                   	push   %ebp
c010183d:	89 e5                	mov    %esp,%ebp
c010183f:	83 ec 44             	sub    $0x44,%esp
    did_init = 1;
c0101842:	c7 05 6c 66 12 c0 01 	movl   $0x1,0xc012666c
c0101849:	00 00 00 
c010184c:	66 c7 45 ca 21 00    	movw   $0x21,-0x36(%ebp)
c0101852:	c6 45 c9 ff          	movb   $0xff,-0x37(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101856:	0f b6 45 c9          	movzbl -0x37(%ebp),%eax
c010185a:	0f b7 55 ca          	movzwl -0x36(%ebp),%edx
c010185e:	ee                   	out    %al,(%dx)
}
c010185f:	90                   	nop
c0101860:	66 c7 45 ce a1 00    	movw   $0xa1,-0x32(%ebp)
c0101866:	c6 45 cd ff          	movb   $0xff,-0x33(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010186a:	0f b6 45 cd          	movzbl -0x33(%ebp),%eax
c010186e:	0f b7 55 ce          	movzwl -0x32(%ebp),%edx
c0101872:	ee                   	out    %al,(%dx)
}
c0101873:	90                   	nop
c0101874:	66 c7 45 d2 20 00    	movw   $0x20,-0x2e(%ebp)
c010187a:	c6 45 d1 11          	movb   $0x11,-0x2f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010187e:	0f b6 45 d1          	movzbl -0x2f(%ebp),%eax
c0101882:	0f b7 55 d2          	movzwl -0x2e(%ebp),%edx
c0101886:	ee                   	out    %al,(%dx)
}
c0101887:	90                   	nop
c0101888:	66 c7 45 d6 21 00    	movw   $0x21,-0x2a(%ebp)
c010188e:	c6 45 d5 20          	movb   $0x20,-0x2b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101892:	0f b6 45 d5          	movzbl -0x2b(%ebp),%eax
c0101896:	0f b7 55 d6          	movzwl -0x2a(%ebp),%edx
c010189a:	ee                   	out    %al,(%dx)
}
c010189b:	90                   	nop
c010189c:	66 c7 45 da 21 00    	movw   $0x21,-0x26(%ebp)
c01018a2:	c6 45 d9 04          	movb   $0x4,-0x27(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018a6:	0f b6 45 d9          	movzbl -0x27(%ebp),%eax
c01018aa:	0f b7 55 da          	movzwl -0x26(%ebp),%edx
c01018ae:	ee                   	out    %al,(%dx)
}
c01018af:	90                   	nop
c01018b0:	66 c7 45 de 21 00    	movw   $0x21,-0x22(%ebp)
c01018b6:	c6 45 dd 03          	movb   $0x3,-0x23(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018ba:	0f b6 45 dd          	movzbl -0x23(%ebp),%eax
c01018be:	0f b7 55 de          	movzwl -0x22(%ebp),%edx
c01018c2:	ee                   	out    %al,(%dx)
}
c01018c3:	90                   	nop
c01018c4:	66 c7 45 e2 a0 00    	movw   $0xa0,-0x1e(%ebp)
c01018ca:	c6 45 e1 11          	movb   $0x11,-0x1f(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018ce:	0f b6 45 e1          	movzbl -0x1f(%ebp),%eax
c01018d2:	0f b7 55 e2          	movzwl -0x1e(%ebp),%edx
c01018d6:	ee                   	out    %al,(%dx)
}
c01018d7:	90                   	nop
c01018d8:	66 c7 45 e6 a1 00    	movw   $0xa1,-0x1a(%ebp)
c01018de:	c6 45 e5 28          	movb   $0x28,-0x1b(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018e2:	0f b6 45 e5          	movzbl -0x1b(%ebp),%eax
c01018e6:	0f b7 55 e6          	movzwl -0x1a(%ebp),%edx
c01018ea:	ee                   	out    %al,(%dx)
}
c01018eb:	90                   	nop
c01018ec:	66 c7 45 ea a1 00    	movw   $0xa1,-0x16(%ebp)
c01018f2:	c6 45 e9 02          	movb   $0x2,-0x17(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c01018f6:	0f b6 45 e9          	movzbl -0x17(%ebp),%eax
c01018fa:	0f b7 55 ea          	movzwl -0x16(%ebp),%edx
c01018fe:	ee                   	out    %al,(%dx)
}
c01018ff:	90                   	nop
c0101900:	66 c7 45 ee a1 00    	movw   $0xa1,-0x12(%ebp)
c0101906:	c6 45 ed 03          	movb   $0x3,-0x13(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010190a:	0f b6 45 ed          	movzbl -0x13(%ebp),%eax
c010190e:	0f b7 55 ee          	movzwl -0x12(%ebp),%edx
c0101912:	ee                   	out    %al,(%dx)
}
c0101913:	90                   	nop
c0101914:	66 c7 45 f2 20 00    	movw   $0x20,-0xe(%ebp)
c010191a:	c6 45 f1 68          	movb   $0x68,-0xf(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010191e:	0f b6 45 f1          	movzbl -0xf(%ebp),%eax
c0101922:	0f b7 55 f2          	movzwl -0xe(%ebp),%edx
c0101926:	ee                   	out    %al,(%dx)
}
c0101927:	90                   	nop
c0101928:	66 c7 45 f6 20 00    	movw   $0x20,-0xa(%ebp)
c010192e:	c6 45 f5 0a          	movb   $0xa,-0xb(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101932:	0f b6 45 f5          	movzbl -0xb(%ebp),%eax
c0101936:	0f b7 55 f6          	movzwl -0xa(%ebp),%edx
c010193a:	ee                   	out    %al,(%dx)
}
c010193b:	90                   	nop
c010193c:	66 c7 45 fa a0 00    	movw   $0xa0,-0x6(%ebp)
c0101942:	c6 45 f9 68          	movb   $0x68,-0x7(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c0101946:	0f b6 45 f9          	movzbl -0x7(%ebp),%eax
c010194a:	0f b7 55 fa          	movzwl -0x6(%ebp),%edx
c010194e:	ee                   	out    %al,(%dx)
}
c010194f:	90                   	nop
c0101950:	66 c7 45 fe a0 00    	movw   $0xa0,-0x2(%ebp)
c0101956:	c6 45 fd 0a          	movb   $0xa,-0x3(%ebp)
    asm volatile ("outb %0, %1" :: "a" (data), "d" (port) : "memory");
c010195a:	0f b6 45 fd          	movzbl -0x3(%ebp),%eax
c010195e:	0f b7 55 fe          	movzwl -0x2(%ebp),%edx
c0101962:	ee                   	out    %al,(%dx)
}
c0101963:	90                   	nop
    outb(IO_PIC1, 0x0a);    // read IRR by default

    outb(IO_PIC2, 0x68);    // OCW3
    outb(IO_PIC2, 0x0a);    // OCW3

    if (irq_mask != 0xFFFF) {
c0101964:	0f b7 05 50 35 12 c0 	movzwl 0xc0123550,%eax
c010196b:	3d ff ff 00 00       	cmp    $0xffff,%eax
c0101970:	74 0f                	je     c0101981 <pic_init+0x149>
        pic_setmask(irq_mask);
c0101972:	0f b7 05 50 35 12 c0 	movzwl 0xc0123550,%eax
c0101979:	89 04 24             	mov    %eax,(%esp)
c010197c:	e8 21 fe ff ff       	call   c01017a2 <pic_setmask>
    }
}
c0101981:	90                   	nop
c0101982:	c9                   	leave  
c0101983:	c3                   	ret    

c0101984 <intr_enable>:
#include <x86.h>
#include <intr.h>

/* intr_enable - enable irq interrupt */
void
intr_enable(void) {
c0101984:	f3 0f 1e fb          	endbr32 
c0101988:	55                   	push   %ebp
c0101989:	89 e5                	mov    %esp,%ebp
    asm volatile ("sti");
c010198b:	fb                   	sti    
}
c010198c:	90                   	nop
    sti();
}
c010198d:	90                   	nop
c010198e:	5d                   	pop    %ebp
c010198f:	c3                   	ret    

c0101990 <intr_disable>:

/* intr_disable - disable irq interrupt */
void
intr_disable(void) {
c0101990:	f3 0f 1e fb          	endbr32 
c0101994:	55                   	push   %ebp
c0101995:	89 e5                	mov    %esp,%ebp
    asm volatile ("cli" ::: "memory");
c0101997:	fa                   	cli    
}
c0101998:	90                   	nop
    cli();
}
c0101999:	90                   	nop
c010199a:	5d                   	pop    %ebp
c010199b:	c3                   	ret    

c010199c <print_ticks>:
#include <console.h>
#include <kdebug.h>

#define TICK_NUM 100

static void print_ticks() {
c010199c:	f3 0f 1e fb          	endbr32 
c01019a0:	55                   	push   %ebp
c01019a1:	89 e5                	mov    %esp,%ebp
c01019a3:	83 ec 18             	sub    $0x18,%esp
    cprintf("%d ticks\n",TICK_NUM);
c01019a6:	c7 44 24 04 64 00 00 	movl   $0x64,0x4(%esp)
c01019ad:	00 
c01019ae:	c7 04 24 c0 98 10 c0 	movl   $0xc01098c0,(%esp)
c01019b5:	e8 fb e8 ff ff       	call   c01002b5 <cprintf>
#ifdef DEBUG_GRADE
    cprintf("End of Test.\n");
    panic("EOT: kernel seems ok.");
#endif
}
c01019ba:	90                   	nop
c01019bb:	c9                   	leave  
c01019bc:	c3                   	ret    

c01019bd <idt_init>:
extern uintptr_t __vectors[];
struct trapframe *switchu2k,*newtf;
uint32_t esp0;
/* idt_init - initialize IDT to each of the entry points in kern/trap/vectors.S */
void
idt_init(void) {
c01019bd:	f3 0f 1e fb          	endbr32 
c01019c1:	55                   	push   %ebp
c01019c2:	89 e5                	mov    %esp,%ebp
c01019c4:	83 ec 10             	sub    $0x10,%esp
      *     Can you see idt[256] in this file? Yes, it's IDT! you can use SETGATE macro to setup each item of IDT
      * (3) After setup the contents of IDT, you will let CPU know where is the IDT by using 'lidt' instruction.
      *     You don't know the meaning of this instruction? just google it! and check the libs/x86.h to know more.
      *     Notice: the argument of lidt is idt_pd. try to find it!
      */
      int isr = 0;
c01019c7:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
      for(; isr < 256; isr++) 
c01019ce:	e9 c4 00 00 00       	jmp    c0101a97 <idt_init+0xda>
      	SETGATE(idt[isr], 0, KERNEL_CS, __vectors[isr], DPL_KERNEL);
c01019d3:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01019d6:	8b 04 85 e0 35 12 c0 	mov    -0x3fedca20(,%eax,4),%eax
c01019dd:	0f b7 d0             	movzwl %ax,%edx
c01019e0:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01019e3:	66 89 14 c5 80 66 12 	mov    %dx,-0x3fed9980(,%eax,8)
c01019ea:	c0 
c01019eb:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01019ee:	66 c7 04 c5 82 66 12 	movw   $0x8,-0x3fed997e(,%eax,8)
c01019f5:	c0 08 00 
c01019f8:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01019fb:	0f b6 14 c5 84 66 12 	movzbl -0x3fed997c(,%eax,8),%edx
c0101a02:	c0 
c0101a03:	80 e2 e0             	and    $0xe0,%dl
c0101a06:	88 14 c5 84 66 12 c0 	mov    %dl,-0x3fed997c(,%eax,8)
c0101a0d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a10:	0f b6 14 c5 84 66 12 	movzbl -0x3fed997c(,%eax,8),%edx
c0101a17:	c0 
c0101a18:	80 e2 1f             	and    $0x1f,%dl
c0101a1b:	88 14 c5 84 66 12 c0 	mov    %dl,-0x3fed997c(,%eax,8)
c0101a22:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a25:	0f b6 14 c5 85 66 12 	movzbl -0x3fed997b(,%eax,8),%edx
c0101a2c:	c0 
c0101a2d:	80 e2 f0             	and    $0xf0,%dl
c0101a30:	80 ca 0e             	or     $0xe,%dl
c0101a33:	88 14 c5 85 66 12 c0 	mov    %dl,-0x3fed997b(,%eax,8)
c0101a3a:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a3d:	0f b6 14 c5 85 66 12 	movzbl -0x3fed997b(,%eax,8),%edx
c0101a44:	c0 
c0101a45:	80 e2 ef             	and    $0xef,%dl
c0101a48:	88 14 c5 85 66 12 c0 	mov    %dl,-0x3fed997b(,%eax,8)
c0101a4f:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a52:	0f b6 14 c5 85 66 12 	movzbl -0x3fed997b(,%eax,8),%edx
c0101a59:	c0 
c0101a5a:	80 e2 9f             	and    $0x9f,%dl
c0101a5d:	88 14 c5 85 66 12 c0 	mov    %dl,-0x3fed997b(,%eax,8)
c0101a64:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a67:	0f b6 14 c5 85 66 12 	movzbl -0x3fed997b(,%eax,8),%edx
c0101a6e:	c0 
c0101a6f:	80 ca 80             	or     $0x80,%dl
c0101a72:	88 14 c5 85 66 12 c0 	mov    %dl,-0x3fed997b(,%eax,8)
c0101a79:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a7c:	8b 04 85 e0 35 12 c0 	mov    -0x3fedca20(,%eax,4),%eax
c0101a83:	c1 e8 10             	shr    $0x10,%eax
c0101a86:	0f b7 d0             	movzwl %ax,%edx
c0101a89:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0101a8c:	66 89 14 c5 86 66 12 	mov    %dx,-0x3fed997a(,%eax,8)
c0101a93:	c0 
      for(; isr < 256; isr++) 
c0101a94:	ff 45 fc             	incl   -0x4(%ebp)
c0101a97:	81 7d fc ff 00 00 00 	cmpl   $0xff,-0x4(%ebp)
c0101a9e:	0f 8e 2f ff ff ff    	jle    c01019d3 <idt_init+0x16>
      SETGATE(idt[T_SWITCH_TOK], 0, GD_KTEXT, __vectors[T_SWITCH_TOK], DPL_USER);
c0101aa4:	a1 c4 37 12 c0       	mov    0xc01237c4,%eax
c0101aa9:	0f b7 c0             	movzwl %ax,%eax
c0101aac:	66 a3 48 6a 12 c0    	mov    %ax,0xc0126a48
c0101ab2:	66 c7 05 4a 6a 12 c0 	movw   $0x8,0xc0126a4a
c0101ab9:	08 00 
c0101abb:	0f b6 05 4c 6a 12 c0 	movzbl 0xc0126a4c,%eax
c0101ac2:	24 e0                	and    $0xe0,%al
c0101ac4:	a2 4c 6a 12 c0       	mov    %al,0xc0126a4c
c0101ac9:	0f b6 05 4c 6a 12 c0 	movzbl 0xc0126a4c,%eax
c0101ad0:	24 1f                	and    $0x1f,%al
c0101ad2:	a2 4c 6a 12 c0       	mov    %al,0xc0126a4c
c0101ad7:	0f b6 05 4d 6a 12 c0 	movzbl 0xc0126a4d,%eax
c0101ade:	24 f0                	and    $0xf0,%al
c0101ae0:	0c 0e                	or     $0xe,%al
c0101ae2:	a2 4d 6a 12 c0       	mov    %al,0xc0126a4d
c0101ae7:	0f b6 05 4d 6a 12 c0 	movzbl 0xc0126a4d,%eax
c0101aee:	24 ef                	and    $0xef,%al
c0101af0:	a2 4d 6a 12 c0       	mov    %al,0xc0126a4d
c0101af5:	0f b6 05 4d 6a 12 c0 	movzbl 0xc0126a4d,%eax
c0101afc:	0c 60                	or     $0x60,%al
c0101afe:	a2 4d 6a 12 c0       	mov    %al,0xc0126a4d
c0101b03:	0f b6 05 4d 6a 12 c0 	movzbl 0xc0126a4d,%eax
c0101b0a:	0c 80                	or     $0x80,%al
c0101b0c:	a2 4d 6a 12 c0       	mov    %al,0xc0126a4d
c0101b11:	a1 c4 37 12 c0       	mov    0xc01237c4,%eax
c0101b16:	c1 e8 10             	shr    $0x10,%eax
c0101b19:	0f b7 c0             	movzwl %ax,%eax
c0101b1c:	66 a3 4e 6a 12 c0    	mov    %ax,0xc0126a4e
      SETGATE(idt[T_SYSCALL], 1, KERNEL_CS, __vectors[T_SYSCALL], DPL_USER);
c0101b22:	a1 e0 37 12 c0       	mov    0xc01237e0,%eax
c0101b27:	0f b7 c0             	movzwl %ax,%eax
c0101b2a:	66 a3 80 6a 12 c0    	mov    %ax,0xc0126a80
c0101b30:	66 c7 05 82 6a 12 c0 	movw   $0x8,0xc0126a82
c0101b37:	08 00 
c0101b39:	0f b6 05 84 6a 12 c0 	movzbl 0xc0126a84,%eax
c0101b40:	24 e0                	and    $0xe0,%al
c0101b42:	a2 84 6a 12 c0       	mov    %al,0xc0126a84
c0101b47:	0f b6 05 84 6a 12 c0 	movzbl 0xc0126a84,%eax
c0101b4e:	24 1f                	and    $0x1f,%al
c0101b50:	a2 84 6a 12 c0       	mov    %al,0xc0126a84
c0101b55:	0f b6 05 85 6a 12 c0 	movzbl 0xc0126a85,%eax
c0101b5c:	0c 0f                	or     $0xf,%al
c0101b5e:	a2 85 6a 12 c0       	mov    %al,0xc0126a85
c0101b63:	0f b6 05 85 6a 12 c0 	movzbl 0xc0126a85,%eax
c0101b6a:	24 ef                	and    $0xef,%al
c0101b6c:	a2 85 6a 12 c0       	mov    %al,0xc0126a85
c0101b71:	0f b6 05 85 6a 12 c0 	movzbl 0xc0126a85,%eax
c0101b78:	0c 60                	or     $0x60,%al
c0101b7a:	a2 85 6a 12 c0       	mov    %al,0xc0126a85
c0101b7f:	0f b6 05 85 6a 12 c0 	movzbl 0xc0126a85,%eax
c0101b86:	0c 80                	or     $0x80,%al
c0101b88:	a2 85 6a 12 c0       	mov    %al,0xc0126a85
c0101b8d:	a1 e0 37 12 c0       	mov    0xc01237e0,%eax
c0101b92:	c1 e8 10             	shr    $0x10,%eax
c0101b95:	0f b7 c0             	movzwl %ax,%eax
c0101b98:	66 a3 86 6a 12 c0    	mov    %ax,0xc0126a86
c0101b9e:	c7 45 f8 60 35 12 c0 	movl   $0xc0123560,-0x8(%ebp)
    asm volatile ("lidt (%0)" :: "r" (pd) : "memory");
c0101ba5:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0101ba8:	0f 01 18             	lidtl  (%eax)
}
c0101bab:	90                   	nop
      lidt(&idt_pd);
}
c0101bac:	90                   	nop
c0101bad:	c9                   	leave  
c0101bae:	c3                   	ret    

c0101baf <trapname>:

static const char *
trapname(int trapno) {
c0101baf:	f3 0f 1e fb          	endbr32 
c0101bb3:	55                   	push   %ebp
c0101bb4:	89 e5                	mov    %esp,%ebp
        "Alignment Check",
        "Machine-Check",
        "SIMD Floating-Point Exception"
    };

    if (trapno < sizeof(excnames)/sizeof(const char * const)) {
c0101bb6:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bb9:	83 f8 13             	cmp    $0x13,%eax
c0101bbc:	77 0c                	ja     c0101bca <trapname+0x1b>
        return excnames[trapno];
c0101bbe:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bc1:	8b 04 85 00 9c 10 c0 	mov    -0x3fef6400(,%eax,4),%eax
c0101bc8:	eb 18                	jmp    c0101be2 <trapname+0x33>
    }
    if (trapno >= IRQ_OFFSET && trapno < IRQ_OFFSET + 16) {
c0101bca:	83 7d 08 1f          	cmpl   $0x1f,0x8(%ebp)
c0101bce:	7e 0d                	jle    c0101bdd <trapname+0x2e>
c0101bd0:	83 7d 08 2f          	cmpl   $0x2f,0x8(%ebp)
c0101bd4:	7f 07                	jg     c0101bdd <trapname+0x2e>
        return "Hardware Interrupt";
c0101bd6:	b8 ca 98 10 c0       	mov    $0xc01098ca,%eax
c0101bdb:	eb 05                	jmp    c0101be2 <trapname+0x33>
    }
    return "(unknown trap)";
c0101bdd:	b8 dd 98 10 c0       	mov    $0xc01098dd,%eax
}
c0101be2:	5d                   	pop    %ebp
c0101be3:	c3                   	ret    

c0101be4 <trap_in_kernel>:

/* trap_in_kernel - test if trap happened in kernel */
bool
trap_in_kernel(struct trapframe *tf) {
c0101be4:	f3 0f 1e fb          	endbr32 
c0101be8:	55                   	push   %ebp
c0101be9:	89 e5                	mov    %esp,%ebp
    return (tf->tf_cs == (uint16_t)KERNEL_CS);
c0101beb:	8b 45 08             	mov    0x8(%ebp),%eax
c0101bee:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101bf2:	83 f8 08             	cmp    $0x8,%eax
c0101bf5:	0f 94 c0             	sete   %al
c0101bf8:	0f b6 c0             	movzbl %al,%eax
}
c0101bfb:	5d                   	pop    %ebp
c0101bfc:	c3                   	ret    

c0101bfd <print_trapframe>:
    "TF", "IF", "DF", "OF", NULL, NULL, "NT", NULL,
    "RF", "VM", "AC", "VIF", "VIP", "ID", NULL, NULL,
};

void
print_trapframe(struct trapframe *tf) {
c0101bfd:	f3 0f 1e fb          	endbr32 
c0101c01:	55                   	push   %ebp
c0101c02:	89 e5                	mov    %esp,%ebp
c0101c04:	83 ec 28             	sub    $0x28,%esp
    cprintf("trapframe at %p\n", tf);
c0101c07:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c0a:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c0e:	c7 04 24 1e 99 10 c0 	movl   $0xc010991e,(%esp)
c0101c15:	e8 9b e6 ff ff       	call   c01002b5 <cprintf>
    print_regs(&tf->tf_regs);
c0101c1a:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c1d:	89 04 24             	mov    %eax,(%esp)
c0101c20:	e8 8d 01 00 00       	call   c0101db2 <print_regs>
    cprintf("  ds   0x----%04x\n", tf->tf_ds);
c0101c25:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c28:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
c0101c2c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c30:	c7 04 24 2f 99 10 c0 	movl   $0xc010992f,(%esp)
c0101c37:	e8 79 e6 ff ff       	call   c01002b5 <cprintf>
    cprintf("  es   0x----%04x\n", tf->tf_es);
c0101c3c:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c3f:	0f b7 40 28          	movzwl 0x28(%eax),%eax
c0101c43:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c47:	c7 04 24 42 99 10 c0 	movl   $0xc0109942,(%esp)
c0101c4e:	e8 62 e6 ff ff       	call   c01002b5 <cprintf>
    cprintf("  fs   0x----%04x\n", tf->tf_fs);
c0101c53:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c56:	0f b7 40 24          	movzwl 0x24(%eax),%eax
c0101c5a:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c5e:	c7 04 24 55 99 10 c0 	movl   $0xc0109955,(%esp)
c0101c65:	e8 4b e6 ff ff       	call   c01002b5 <cprintf>
    cprintf("  gs   0x----%04x\n", tf->tf_gs);
c0101c6a:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c6d:	0f b7 40 20          	movzwl 0x20(%eax),%eax
c0101c71:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101c75:	c7 04 24 68 99 10 c0 	movl   $0xc0109968,(%esp)
c0101c7c:	e8 34 e6 ff ff       	call   c01002b5 <cprintf>
    cprintf("  trap 0x%08x %s\n", tf->tf_trapno, trapname(tf->tf_trapno));
c0101c81:	8b 45 08             	mov    0x8(%ebp),%eax
c0101c84:	8b 40 30             	mov    0x30(%eax),%eax
c0101c87:	89 04 24             	mov    %eax,(%esp)
c0101c8a:	e8 20 ff ff ff       	call   c0101baf <trapname>
c0101c8f:	8b 55 08             	mov    0x8(%ebp),%edx
c0101c92:	8b 52 30             	mov    0x30(%edx),%edx
c0101c95:	89 44 24 08          	mov    %eax,0x8(%esp)
c0101c99:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101c9d:	c7 04 24 7b 99 10 c0 	movl   $0xc010997b,(%esp)
c0101ca4:	e8 0c e6 ff ff       	call   c01002b5 <cprintf>
    cprintf("  err  0x%08x\n", tf->tf_err);
c0101ca9:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cac:	8b 40 34             	mov    0x34(%eax),%eax
c0101caf:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101cb3:	c7 04 24 8d 99 10 c0 	movl   $0xc010998d,(%esp)
c0101cba:	e8 f6 e5 ff ff       	call   c01002b5 <cprintf>
    cprintf("  eip  0x%08x\n", tf->tf_eip);
c0101cbf:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cc2:	8b 40 38             	mov    0x38(%eax),%eax
c0101cc5:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101cc9:	c7 04 24 9c 99 10 c0 	movl   $0xc010999c,(%esp)
c0101cd0:	e8 e0 e5 ff ff       	call   c01002b5 <cprintf>
    cprintf("  cs   0x----%04x\n", tf->tf_cs);
c0101cd5:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cd8:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101cdc:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101ce0:	c7 04 24 ab 99 10 c0 	movl   $0xc01099ab,(%esp)
c0101ce7:	e8 c9 e5 ff ff       	call   c01002b5 <cprintf>
    cprintf("  flag 0x%08x ", tf->tf_eflags);
c0101cec:	8b 45 08             	mov    0x8(%ebp),%eax
c0101cef:	8b 40 40             	mov    0x40(%eax),%eax
c0101cf2:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101cf6:	c7 04 24 be 99 10 c0 	movl   $0xc01099be,(%esp)
c0101cfd:	e8 b3 e5 ff ff       	call   c01002b5 <cprintf>

    int i, j;
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c0101d02:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0101d09:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
c0101d10:	eb 3d                	jmp    c0101d4f <print_trapframe+0x152>
        if ((tf->tf_eflags & j) && IA32flags[i] != NULL) {
c0101d12:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d15:	8b 50 40             	mov    0x40(%eax),%edx
c0101d18:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0101d1b:	21 d0                	and    %edx,%eax
c0101d1d:	85 c0                	test   %eax,%eax
c0101d1f:	74 28                	je     c0101d49 <print_trapframe+0x14c>
c0101d21:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101d24:	8b 04 85 80 35 12 c0 	mov    -0x3fedca80(,%eax,4),%eax
c0101d2b:	85 c0                	test   %eax,%eax
c0101d2d:	74 1a                	je     c0101d49 <print_trapframe+0x14c>
            cprintf("%s,", IA32flags[i]);
c0101d2f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101d32:	8b 04 85 80 35 12 c0 	mov    -0x3fedca80(,%eax,4),%eax
c0101d39:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d3d:	c7 04 24 cd 99 10 c0 	movl   $0xc01099cd,(%esp)
c0101d44:	e8 6c e5 ff ff       	call   c01002b5 <cprintf>
    for (i = 0, j = 1; i < sizeof(IA32flags) / sizeof(IA32flags[0]); i ++, j <<= 1) {
c0101d49:	ff 45 f4             	incl   -0xc(%ebp)
c0101d4c:	d1 65 f0             	shll   -0x10(%ebp)
c0101d4f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0101d52:	83 f8 17             	cmp    $0x17,%eax
c0101d55:	76 bb                	jbe    c0101d12 <print_trapframe+0x115>
        }
    }
    cprintf("IOPL=%d\n", (tf->tf_eflags & FL_IOPL_MASK) >> 12);
c0101d57:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d5a:	8b 40 40             	mov    0x40(%eax),%eax
c0101d5d:	c1 e8 0c             	shr    $0xc,%eax
c0101d60:	83 e0 03             	and    $0x3,%eax
c0101d63:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d67:	c7 04 24 d1 99 10 c0 	movl   $0xc01099d1,(%esp)
c0101d6e:	e8 42 e5 ff ff       	call   c01002b5 <cprintf>

    if (!trap_in_kernel(tf)) {
c0101d73:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d76:	89 04 24             	mov    %eax,(%esp)
c0101d79:	e8 66 fe ff ff       	call   c0101be4 <trap_in_kernel>
c0101d7e:	85 c0                	test   %eax,%eax
c0101d80:	75 2d                	jne    c0101daf <print_trapframe+0x1b2>
        cprintf("  esp  0x%08x\n", tf->tf_esp);
c0101d82:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d85:	8b 40 44             	mov    0x44(%eax),%eax
c0101d88:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101d8c:	c7 04 24 da 99 10 c0 	movl   $0xc01099da,(%esp)
c0101d93:	e8 1d e5 ff ff       	call   c01002b5 <cprintf>
        cprintf("  ss   0x----%04x\n", tf->tf_ss);
c0101d98:	8b 45 08             	mov    0x8(%ebp),%eax
c0101d9b:	0f b7 40 48          	movzwl 0x48(%eax),%eax
c0101d9f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101da3:	c7 04 24 e9 99 10 c0 	movl   $0xc01099e9,(%esp)
c0101daa:	e8 06 e5 ff ff       	call   c01002b5 <cprintf>
    }
}
c0101daf:	90                   	nop
c0101db0:	c9                   	leave  
c0101db1:	c3                   	ret    

c0101db2 <print_regs>:

void
print_regs(struct pushregs *regs) {
c0101db2:	f3 0f 1e fb          	endbr32 
c0101db6:	55                   	push   %ebp
c0101db7:	89 e5                	mov    %esp,%ebp
c0101db9:	83 ec 18             	sub    $0x18,%esp
    cprintf("  edi  0x%08x\n", regs->reg_edi);
c0101dbc:	8b 45 08             	mov    0x8(%ebp),%eax
c0101dbf:	8b 00                	mov    (%eax),%eax
c0101dc1:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101dc5:	c7 04 24 fc 99 10 c0 	movl   $0xc01099fc,(%esp)
c0101dcc:	e8 e4 e4 ff ff       	call   c01002b5 <cprintf>
    cprintf("  esi  0x%08x\n", regs->reg_esi);
c0101dd1:	8b 45 08             	mov    0x8(%ebp),%eax
c0101dd4:	8b 40 04             	mov    0x4(%eax),%eax
c0101dd7:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101ddb:	c7 04 24 0b 9a 10 c0 	movl   $0xc0109a0b,(%esp)
c0101de2:	e8 ce e4 ff ff       	call   c01002b5 <cprintf>
    cprintf("  ebp  0x%08x\n", regs->reg_ebp);
c0101de7:	8b 45 08             	mov    0x8(%ebp),%eax
c0101dea:	8b 40 08             	mov    0x8(%eax),%eax
c0101ded:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101df1:	c7 04 24 1a 9a 10 c0 	movl   $0xc0109a1a,(%esp)
c0101df8:	e8 b8 e4 ff ff       	call   c01002b5 <cprintf>
    cprintf("  oesp 0x%08x\n", regs->reg_oesp);
c0101dfd:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e00:	8b 40 0c             	mov    0xc(%eax),%eax
c0101e03:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101e07:	c7 04 24 29 9a 10 c0 	movl   $0xc0109a29,(%esp)
c0101e0e:	e8 a2 e4 ff ff       	call   c01002b5 <cprintf>
    cprintf("  ebx  0x%08x\n", regs->reg_ebx);
c0101e13:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e16:	8b 40 10             	mov    0x10(%eax),%eax
c0101e19:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101e1d:	c7 04 24 38 9a 10 c0 	movl   $0xc0109a38,(%esp)
c0101e24:	e8 8c e4 ff ff       	call   c01002b5 <cprintf>
    cprintf("  edx  0x%08x\n", regs->reg_edx);
c0101e29:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e2c:	8b 40 14             	mov    0x14(%eax),%eax
c0101e2f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101e33:	c7 04 24 47 9a 10 c0 	movl   $0xc0109a47,(%esp)
c0101e3a:	e8 76 e4 ff ff       	call   c01002b5 <cprintf>
    cprintf("  ecx  0x%08x\n", regs->reg_ecx);
c0101e3f:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e42:	8b 40 18             	mov    0x18(%eax),%eax
c0101e45:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101e49:	c7 04 24 56 9a 10 c0 	movl   $0xc0109a56,(%esp)
c0101e50:	e8 60 e4 ff ff       	call   c01002b5 <cprintf>
    cprintf("  eax  0x%08x\n", regs->reg_eax);
c0101e55:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e58:	8b 40 1c             	mov    0x1c(%eax),%eax
c0101e5b:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101e5f:	c7 04 24 65 9a 10 c0 	movl   $0xc0109a65,(%esp)
c0101e66:	e8 4a e4 ff ff       	call   c01002b5 <cprintf>
}
c0101e6b:	90                   	nop
c0101e6c:	c9                   	leave  
c0101e6d:	c3                   	ret    

c0101e6e <trap_dispatch>:

/* trap_dispatch - dispatch based on what type of trap occurred */
static void
trap_dispatch(struct trapframe *tf) {
c0101e6e:	f3 0f 1e fb          	endbr32 
c0101e72:	55                   	push   %ebp
c0101e73:	89 e5                	mov    %esp,%ebp
c0101e75:	83 ec 28             	sub    $0x28,%esp
    char c;

    switch (tf->tf_trapno) {
c0101e78:	8b 45 08             	mov    0x8(%ebp),%eax
c0101e7b:	8b 40 30             	mov    0x30(%eax),%eax
c0101e7e:	83 f8 79             	cmp    $0x79,%eax
c0101e81:	0f 84 db 02 00 00    	je     c0102162 <trap_dispatch+0x2f4>
c0101e87:	83 f8 79             	cmp    $0x79,%eax
c0101e8a:	0f 87 4f 03 00 00    	ja     c01021df <trap_dispatch+0x371>
c0101e90:	83 f8 78             	cmp    $0x78,%eax
c0101e93:	0f 84 00 02 00 00    	je     c0102099 <trap_dispatch+0x22b>
c0101e99:	83 f8 78             	cmp    $0x78,%eax
c0101e9c:	0f 87 3d 03 00 00    	ja     c01021df <trap_dispatch+0x371>
c0101ea2:	83 f8 24             	cmp    $0x24,%eax
c0101ea5:	74 49                	je     c0101ef0 <trap_dispatch+0x82>
c0101ea7:	83 f8 24             	cmp    $0x24,%eax
c0101eaa:	0f 87 2f 03 00 00    	ja     c01021df <trap_dispatch+0x371>
c0101eb0:	83 f8 20             	cmp    $0x20,%eax
c0101eb3:	74 0e                	je     c0101ec3 <trap_dispatch+0x55>
c0101eb5:	83 f8 21             	cmp    $0x21,%eax
c0101eb8:	0f 84 b7 01 00 00    	je     c0102075 <trap_dispatch+0x207>
c0101ebe:	e9 1c 03 00 00       	jmp    c01021df <trap_dispatch+0x371>
        /* handle the timer interrupt */
        /* (1) After a timer interrupt, you should record this event using a global variable (increase it), such as ticks in kern/driver/clock.c
         * (2) Every TICK_NUM cycle, you can print some info using a funciton, such as print_ticks().
         * (3) Too Simple? Yes, I think so!
         */
        ticks ++;
c0101ec3:	a1 a0 6f 12 c0       	mov    0xc0126fa0,%eax
c0101ec8:	40                   	inc    %eax
c0101ec9:	a3 a0 6f 12 c0       	mov    %eax,0xc0126fa0
        if (ticks == TICK_NUM)
c0101ece:	a1 a0 6f 12 c0       	mov    0xc0126fa0,%eax
c0101ed3:	83 f8 64             	cmp    $0x64,%eax
c0101ed6:	0f 85 38 03 00 00    	jne    c0102214 <trap_dispatch+0x3a6>
        {
            ticks = 0;
c0101edc:	c7 05 a0 6f 12 c0 00 	movl   $0x0,0xc0126fa0
c0101ee3:	00 00 00 
            print_ticks();
c0101ee6:	e8 b1 fa ff ff       	call   c010199c <print_ticks>
        }
        break;
c0101eeb:	e9 24 03 00 00       	jmp    c0102214 <trap_dispatch+0x3a6>
    case IRQ_OFFSET + IRQ_COM1:
        c = cons_getc();
c0101ef0:	e8 3a f8 ff ff       	call   c010172f <cons_getc>
c0101ef5:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("serial %c\n", c);
c0101ef8:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0101efc:	89 44 24 04          	mov    %eax,0x4(%esp)
c0101f00:	c7 04 24 74 9a 10 c0 	movl   $0xc0109a74,(%esp)
c0101f07:	e8 a9 e3 ff ff       	call   c01002b5 <cprintf>
        switch(c)
c0101f0c:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0101f10:	83 f8 30             	cmp    $0x30,%eax
c0101f13:	74 0e                	je     c0101f23 <trap_dispatch+0xb5>
c0101f15:	83 f8 33             	cmp    $0x33,%eax
c0101f18:	0f 84 85 00 00 00    	je     c0101fa3 <trap_dispatch+0x135>
			newtf->tf_eflags |= FL_IOPL_MASK;
			*((uint32_t *)tf - 1) = (uint32_t)newtf;
		}
		break;
        }
        break;
c0101f1e:	e9 f8 02 00 00       	jmp    c010221b <trap_dispatch+0x3ad>
        	if (tf->tf_cs != KERNEL_CS) {
c0101f23:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f26:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0101f2a:	83 f8 08             	cmp    $0x8,%eax
c0101f2d:	0f 84 36 01 00 00    	je     c0102069 <trap_dispatch+0x1fb>
            		tf->tf_cs = KERNEL_CS;
c0101f33:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f36:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
            		tf->tf_ds = tf->tf_es = KERNEL_DS;
c0101f3c:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f3f:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
c0101f45:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f48:	0f b7 50 28          	movzwl 0x28(%eax),%edx
c0101f4c:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f4f:	66 89 50 2c          	mov    %dx,0x2c(%eax)
            		tf->tf_eflags &= ~FL_IOPL_MASK;
c0101f53:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f56:	8b 40 40             	mov    0x40(%eax),%eax
c0101f59:	25 ff cf ff ff       	and    $0xffffcfff,%eax
c0101f5e:	89 c2                	mov    %eax,%edx
c0101f60:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f63:	89 50 40             	mov    %edx,0x40(%eax)
            		switchu2k = (struct trapframe *)(tf->tf_esp - (sizeof(struct trapframe) - 8));
c0101f66:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f69:	8b 40 44             	mov    0x44(%eax),%eax
c0101f6c:	83 e8 44             	sub    $0x44,%eax
c0101f6f:	a3 ac 6f 12 c0       	mov    %eax,0xc0126fac
            		memmove(switchu2k, tf, sizeof(struct trapframe) - 8);
c0101f74:	a1 ac 6f 12 c0       	mov    0xc0126fac,%eax
c0101f79:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
c0101f80:	00 
c0101f81:	8b 55 08             	mov    0x8(%ebp),%edx
c0101f84:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101f88:	89 04 24             	mov    %eax,(%esp)
c0101f8b:	e8 91 6d 00 00       	call   c0108d21 <memmove>
            		*((uint32_t *)tf - 1) = (uint32_t)switchu2k;
c0101f90:	8b 15 ac 6f 12 c0    	mov    0xc0126fac,%edx
c0101f96:	8b 45 08             	mov    0x8(%ebp),%eax
c0101f99:	83 e8 04             	sub    $0x4,%eax
c0101f9c:	89 10                	mov    %edx,(%eax)
        	break;
c0101f9e:	e9 c6 00 00 00       	jmp    c0102069 <trap_dispatch+0x1fb>
        	asm volatile("movl %%esp, %0" : "=r" (esp0));
c0101fa3:	89 e0                	mov    %esp,%eax
c0101fa5:	a3 a4 6f 12 c0       	mov    %eax,0xc0126fa4
		newtf=(struct trapframe *)(esp0-0x200);
c0101faa:	a1 a4 6f 12 c0       	mov    0xc0126fa4,%eax
c0101faf:	2d 00 02 00 00       	sub    $0x200,%eax
c0101fb4:	a3 a8 6f 12 c0       	mov    %eax,0xc0126fa8
		if (trap_in_kernel(tf)) {
c0101fb9:	8b 45 08             	mov    0x8(%ebp),%eax
c0101fbc:	89 04 24             	mov    %eax,(%esp)
c0101fbf:	e8 20 fc ff ff       	call   c0101be4 <trap_in_kernel>
c0101fc4:	85 c0                	test   %eax,%eax
c0101fc6:	0f 84 a3 00 00 00    	je     c010206f <trap_dispatch+0x201>
			memmove(newtf, tf, sizeof(struct trapframe) - 8);
c0101fcc:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c0101fd1:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
c0101fd8:	00 
c0101fd9:	8b 55 08             	mov    0x8(%ebp),%edx
c0101fdc:	89 54 24 04          	mov    %edx,0x4(%esp)
c0101fe0:	89 04 24             	mov    %eax,(%esp)
c0101fe3:	e8 39 6d 00 00       	call   c0108d21 <memmove>
			newtf->tf_cs = USER_CS;
c0101fe8:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c0101fed:	66 c7 40 3c 1b 00    	movw   $0x1b,0x3c(%eax)
			newtf->tf_ss = newtf->tf_ds = newtf->tf_es = newtf->tf_gs = newtf->tf_fs = USER_DS;
c0101ff3:	8b 15 a8 6f 12 c0    	mov    0xc0126fa8,%edx
c0101ff9:	66 c7 42 24 23 00    	movw   $0x23,0x24(%edx)
c0101fff:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c0102004:	0f b7 52 24          	movzwl 0x24(%edx),%edx
c0102008:	66 89 50 20          	mov    %dx,0x20(%eax)
c010200c:	8b 15 a8 6f 12 c0    	mov    0xc0126fa8,%edx
c0102012:	0f b7 40 20          	movzwl 0x20(%eax),%eax
c0102016:	66 89 42 28          	mov    %ax,0x28(%edx)
c010201a:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c010201f:	0f b7 52 28          	movzwl 0x28(%edx),%edx
c0102023:	66 89 50 2c          	mov    %dx,0x2c(%eax)
c0102027:	8b 15 a8 6f 12 c0    	mov    0xc0126fa8,%edx
c010202d:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
c0102031:	66 89 42 48          	mov    %ax,0x48(%edx)
			newtf->tf_esp = (uint32_t)tf + (sizeof(struct trapframe)-8);
c0102035:	8b 55 08             	mov    0x8(%ebp),%edx
c0102038:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c010203d:	83 c2 44             	add    $0x44,%edx
c0102040:	89 50 44             	mov    %edx,0x44(%eax)
			newtf->tf_eflags |= FL_IOPL_MASK;
c0102043:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c0102048:	8b 50 40             	mov    0x40(%eax),%edx
c010204b:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c0102050:	81 ca 00 30 00 00    	or     $0x3000,%edx
c0102056:	89 50 40             	mov    %edx,0x40(%eax)
			*((uint32_t *)tf - 1) = (uint32_t)newtf;
c0102059:	8b 15 a8 6f 12 c0    	mov    0xc0126fa8,%edx
c010205f:	8b 45 08             	mov    0x8(%ebp),%eax
c0102062:	83 e8 04             	sub    $0x4,%eax
c0102065:	89 10                	mov    %edx,(%eax)
		break;
c0102067:	eb 06                	jmp    c010206f <trap_dispatch+0x201>
        	break;
c0102069:	90                   	nop
c010206a:	e9 ac 01 00 00       	jmp    c010221b <trap_dispatch+0x3ad>
		break;
c010206f:	90                   	nop
        break;
c0102070:	e9 a6 01 00 00       	jmp    c010221b <trap_dispatch+0x3ad>
    case IRQ_OFFSET + IRQ_KBD:
        c = cons_getc();
c0102075:	e8 b5 f6 ff ff       	call   c010172f <cons_getc>
c010207a:	88 45 f7             	mov    %al,-0x9(%ebp)
        cprintf("kbd [%03d] %c\n", c, c);
c010207d:	0f be 55 f7          	movsbl -0x9(%ebp),%edx
c0102081:	0f be 45 f7          	movsbl -0x9(%ebp),%eax
c0102085:	89 54 24 08          	mov    %edx,0x8(%esp)
c0102089:	89 44 24 04          	mov    %eax,0x4(%esp)
c010208d:	c7 04 24 7f 9a 10 c0 	movl   $0xc0109a7f,(%esp)
c0102094:	e8 1c e2 ff ff       	call   c01002b5 <cprintf>
			tf->tf_ss = tf->tf_ds = tf->tf_es = tf->tf_gs = tf->tf_fs = USER_DS;
			tf->tf_esp += 4;
			tf->tf_eflags |= FL_IOPL_MASK;
		}
		break;*/
		asm volatile("movl %%esp, %0" : "=r" (esp0));
c0102099:	89 e0                	mov    %esp,%eax
c010209b:	a3 a4 6f 12 c0       	mov    %eax,0xc0126fa4
		newtf=(struct trapframe *)(esp0-0x100);
c01020a0:	a1 a4 6f 12 c0       	mov    0xc0126fa4,%eax
c01020a5:	2d 00 01 00 00       	sub    $0x100,%eax
c01020aa:	a3 a8 6f 12 c0       	mov    %eax,0xc0126fa8
		if (trap_in_kernel(tf)) {
c01020af:	8b 45 08             	mov    0x8(%ebp),%eax
c01020b2:	89 04 24             	mov    %eax,(%esp)
c01020b5:	e8 2a fb ff ff       	call   c0101be4 <trap_in_kernel>
c01020ba:	85 c0                	test   %eax,%eax
c01020bc:	0f 84 55 01 00 00    	je     c0102217 <trap_dispatch+0x3a9>
			memmove(newtf, tf, sizeof(struct trapframe) - 8);
c01020c2:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c01020c7:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
c01020ce:	00 
c01020cf:	8b 55 08             	mov    0x8(%ebp),%edx
c01020d2:	89 54 24 04          	mov    %edx,0x4(%esp)
c01020d6:	89 04 24             	mov    %eax,(%esp)
c01020d9:	e8 43 6c 00 00       	call   c0108d21 <memmove>
			newtf->tf_cs = USER_CS;
c01020de:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c01020e3:	66 c7 40 3c 1b 00    	movw   $0x1b,0x3c(%eax)
			newtf->tf_ss = newtf->tf_ds = newtf->tf_es = newtf->tf_gs = newtf->tf_fs = USER_DS;
c01020e9:	8b 15 a8 6f 12 c0    	mov    0xc0126fa8,%edx
c01020ef:	66 c7 42 24 23 00    	movw   $0x23,0x24(%edx)
c01020f5:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c01020fa:	0f b7 52 24          	movzwl 0x24(%edx),%edx
c01020fe:	66 89 50 20          	mov    %dx,0x20(%eax)
c0102102:	8b 15 a8 6f 12 c0    	mov    0xc0126fa8,%edx
c0102108:	0f b7 40 20          	movzwl 0x20(%eax),%eax
c010210c:	66 89 42 28          	mov    %ax,0x28(%edx)
c0102110:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c0102115:	0f b7 52 28          	movzwl 0x28(%edx),%edx
c0102119:	66 89 50 2c          	mov    %dx,0x2c(%eax)
c010211d:	8b 15 a8 6f 12 c0    	mov    0xc0126fa8,%edx
c0102123:	0f b7 40 2c          	movzwl 0x2c(%eax),%eax
c0102127:	66 89 42 48          	mov    %ax,0x48(%edx)
			newtf->tf_esp = (uint32_t)tf + sizeof(struct trapframe);
c010212b:	8b 55 08             	mov    0x8(%ebp),%edx
c010212e:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c0102133:	83 c2 4c             	add    $0x4c,%edx
c0102136:	89 50 44             	mov    %edx,0x44(%eax)
			newtf->tf_eflags |= FL_IOPL_MASK;
c0102139:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c010213e:	8b 50 40             	mov    0x40(%eax),%edx
c0102141:	a1 a8 6f 12 c0       	mov    0xc0126fa8,%eax
c0102146:	81 ca 00 30 00 00    	or     $0x3000,%edx
c010214c:	89 50 40             	mov    %edx,0x40(%eax)
			*((uint32_t *)tf - 1) = (uint32_t)newtf;
c010214f:	8b 15 a8 6f 12 c0    	mov    0xc0126fa8,%edx
c0102155:	8b 45 08             	mov    0x8(%ebp),%eax
c0102158:	83 e8 04             	sub    $0x4,%eax
c010215b:	89 10                	mov    %edx,(%eax)
		}
		break;
c010215d:	e9 b5 00 00 00       	jmp    c0102217 <trap_dispatch+0x3a9>
    case T_SWITCH_TOK:
    if (tf->tf_cs != KERNEL_CS) {
c0102162:	8b 45 08             	mov    0x8(%ebp),%eax
c0102165:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c0102169:	83 f8 08             	cmp    $0x8,%eax
c010216c:	0f 84 a8 00 00 00    	je     c010221a <trap_dispatch+0x3ac>
            tf->tf_cs = KERNEL_CS;
c0102172:	8b 45 08             	mov    0x8(%ebp),%eax
c0102175:	66 c7 40 3c 08 00    	movw   $0x8,0x3c(%eax)
            tf->tf_ds = tf->tf_es = KERNEL_DS;
c010217b:	8b 45 08             	mov    0x8(%ebp),%eax
c010217e:	66 c7 40 28 10 00    	movw   $0x10,0x28(%eax)
c0102184:	8b 45 08             	mov    0x8(%ebp),%eax
c0102187:	0f b7 50 28          	movzwl 0x28(%eax),%edx
c010218b:	8b 45 08             	mov    0x8(%ebp),%eax
c010218e:	66 89 50 2c          	mov    %dx,0x2c(%eax)
            tf->tf_eflags &= ~FL_IOPL_MASK;
c0102192:	8b 45 08             	mov    0x8(%ebp),%eax
c0102195:	8b 40 40             	mov    0x40(%eax),%eax
c0102198:	25 ff cf ff ff       	and    $0xffffcfff,%eax
c010219d:	89 c2                	mov    %eax,%edx
c010219f:	8b 45 08             	mov    0x8(%ebp),%eax
c01021a2:	89 50 40             	mov    %edx,0x40(%eax)
            switchu2k = (struct trapframe *)(tf->tf_esp - (sizeof(struct trapframe) - 8));
c01021a5:	8b 45 08             	mov    0x8(%ebp),%eax
c01021a8:	8b 40 44             	mov    0x44(%eax),%eax
c01021ab:	83 e8 44             	sub    $0x44,%eax
c01021ae:	a3 ac 6f 12 c0       	mov    %eax,0xc0126fac
            memmove(switchu2k, tf, sizeof(struct trapframe) - 8);
c01021b3:	a1 ac 6f 12 c0       	mov    0xc0126fac,%eax
c01021b8:	c7 44 24 08 44 00 00 	movl   $0x44,0x8(%esp)
c01021bf:	00 
c01021c0:	8b 55 08             	mov    0x8(%ebp),%edx
c01021c3:	89 54 24 04          	mov    %edx,0x4(%esp)
c01021c7:	89 04 24             	mov    %eax,(%esp)
c01021ca:	e8 52 6b 00 00       	call   c0108d21 <memmove>
            *((uint32_t *)tf - 1) = (uint32_t)switchu2k;
c01021cf:	8b 15 ac 6f 12 c0    	mov    0xc0126fac,%edx
c01021d5:	8b 45 08             	mov    0x8(%ebp),%eax
c01021d8:	83 e8 04             	sub    $0x4,%eax
c01021db:	89 10                	mov    %edx,(%eax)
        }
        break;
c01021dd:	eb 3b                	jmp    c010221a <trap_dispatch+0x3ac>
    default:
        // in kernel, it must be a mistake
        if ((tf->tf_cs & 3) == 0) {
c01021df:	8b 45 08             	mov    0x8(%ebp),%eax
c01021e2:	0f b7 40 3c          	movzwl 0x3c(%eax),%eax
c01021e6:	83 e0 03             	and    $0x3,%eax
c01021e9:	85 c0                	test   %eax,%eax
c01021eb:	75 2e                	jne    c010221b <trap_dispatch+0x3ad>
            print_trapframe(tf);
c01021ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01021f0:	89 04 24             	mov    %eax,(%esp)
c01021f3:	e8 05 fa ff ff       	call   c0101bfd <print_trapframe>
            panic("unexpected trap in kernel.\n");
c01021f8:	c7 44 24 08 8e 9a 10 	movl   $0xc0109a8e,0x8(%esp)
c01021ff:	c0 
c0102200:	c7 44 24 04 e8 00 00 	movl   $0xe8,0x4(%esp)
c0102207:	00 
c0102208:	c7 04 24 aa 9a 10 c0 	movl   $0xc0109aaa,(%esp)
c010220f:	e8 0d e2 ff ff       	call   c0100421 <__panic>
        break;
c0102214:	90                   	nop
c0102215:	eb 04                	jmp    c010221b <trap_dispatch+0x3ad>
		break;
c0102217:	90                   	nop
c0102218:	eb 01                	jmp    c010221b <trap_dispatch+0x3ad>
        break;
c010221a:	90                   	nop
        }
    }
}
c010221b:	90                   	nop
c010221c:	c9                   	leave  
c010221d:	c3                   	ret    

c010221e <trap>:
 * trap - handles or dispatches an exception/interrupt. if and when trap() returns,
 * the code in kern/trap/trapentry.S restores the old CPU state saved in the
 * trapframe and then uses the iret instruction to return from the exception.
 * */
void
trap(struct trapframe *tf) {
c010221e:	f3 0f 1e fb          	endbr32 
c0102222:	55                   	push   %ebp
c0102223:	89 e5                	mov    %esp,%ebp
c0102225:	83 ec 18             	sub    $0x18,%esp
    // dispatch based on what type of trap occurred
    trap_dispatch(tf);
c0102228:	8b 45 08             	mov    0x8(%ebp),%eax
c010222b:	89 04 24             	mov    %eax,(%esp)
c010222e:	e8 3b fc ff ff       	call   c0101e6e <trap_dispatch>
}
c0102233:	90                   	nop
c0102234:	c9                   	leave  
c0102235:	c3                   	ret    

c0102236 <vector0>:
# handler
.text
.globl __alltraps
.globl vector0
vector0:
  pushl $0
c0102236:	6a 00                	push   $0x0
  pushl $0
c0102238:	6a 00                	push   $0x0
  jmp __alltraps
c010223a:	e9 69 0a 00 00       	jmp    c0102ca8 <__alltraps>

c010223f <vector1>:
.globl vector1
vector1:
  pushl $0
c010223f:	6a 00                	push   $0x0
  pushl $1
c0102241:	6a 01                	push   $0x1
  jmp __alltraps
c0102243:	e9 60 0a 00 00       	jmp    c0102ca8 <__alltraps>

c0102248 <vector2>:
.globl vector2
vector2:
  pushl $0
c0102248:	6a 00                	push   $0x0
  pushl $2
c010224a:	6a 02                	push   $0x2
  jmp __alltraps
c010224c:	e9 57 0a 00 00       	jmp    c0102ca8 <__alltraps>

c0102251 <vector3>:
.globl vector3
vector3:
  pushl $0
c0102251:	6a 00                	push   $0x0
  pushl $3
c0102253:	6a 03                	push   $0x3
  jmp __alltraps
c0102255:	e9 4e 0a 00 00       	jmp    c0102ca8 <__alltraps>

c010225a <vector4>:
.globl vector4
vector4:
  pushl $0
c010225a:	6a 00                	push   $0x0
  pushl $4
c010225c:	6a 04                	push   $0x4
  jmp __alltraps
c010225e:	e9 45 0a 00 00       	jmp    c0102ca8 <__alltraps>

c0102263 <vector5>:
.globl vector5
vector5:
  pushl $0
c0102263:	6a 00                	push   $0x0
  pushl $5
c0102265:	6a 05                	push   $0x5
  jmp __alltraps
c0102267:	e9 3c 0a 00 00       	jmp    c0102ca8 <__alltraps>

c010226c <vector6>:
.globl vector6
vector6:
  pushl $0
c010226c:	6a 00                	push   $0x0
  pushl $6
c010226e:	6a 06                	push   $0x6
  jmp __alltraps
c0102270:	e9 33 0a 00 00       	jmp    c0102ca8 <__alltraps>

c0102275 <vector7>:
.globl vector7
vector7:
  pushl $0
c0102275:	6a 00                	push   $0x0
  pushl $7
c0102277:	6a 07                	push   $0x7
  jmp __alltraps
c0102279:	e9 2a 0a 00 00       	jmp    c0102ca8 <__alltraps>

c010227e <vector8>:
.globl vector8
vector8:
  pushl $8
c010227e:	6a 08                	push   $0x8
  jmp __alltraps
c0102280:	e9 23 0a 00 00       	jmp    c0102ca8 <__alltraps>

c0102285 <vector9>:
.globl vector9
vector9:
  pushl $0
c0102285:	6a 00                	push   $0x0
  pushl $9
c0102287:	6a 09                	push   $0x9
  jmp __alltraps
c0102289:	e9 1a 0a 00 00       	jmp    c0102ca8 <__alltraps>

c010228e <vector10>:
.globl vector10
vector10:
  pushl $10
c010228e:	6a 0a                	push   $0xa
  jmp __alltraps
c0102290:	e9 13 0a 00 00       	jmp    c0102ca8 <__alltraps>

c0102295 <vector11>:
.globl vector11
vector11:
  pushl $11
c0102295:	6a 0b                	push   $0xb
  jmp __alltraps
c0102297:	e9 0c 0a 00 00       	jmp    c0102ca8 <__alltraps>

c010229c <vector12>:
.globl vector12
vector12:
  pushl $12
c010229c:	6a 0c                	push   $0xc
  jmp __alltraps
c010229e:	e9 05 0a 00 00       	jmp    c0102ca8 <__alltraps>

c01022a3 <vector13>:
.globl vector13
vector13:
  pushl $13
c01022a3:	6a 0d                	push   $0xd
  jmp __alltraps
c01022a5:	e9 fe 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022aa <vector14>:
.globl vector14
vector14:
  pushl $14
c01022aa:	6a 0e                	push   $0xe
  jmp __alltraps
c01022ac:	e9 f7 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022b1 <vector15>:
.globl vector15
vector15:
  pushl $0
c01022b1:	6a 00                	push   $0x0
  pushl $15
c01022b3:	6a 0f                	push   $0xf
  jmp __alltraps
c01022b5:	e9 ee 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022ba <vector16>:
.globl vector16
vector16:
  pushl $0
c01022ba:	6a 00                	push   $0x0
  pushl $16
c01022bc:	6a 10                	push   $0x10
  jmp __alltraps
c01022be:	e9 e5 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022c3 <vector17>:
.globl vector17
vector17:
  pushl $17
c01022c3:	6a 11                	push   $0x11
  jmp __alltraps
c01022c5:	e9 de 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022ca <vector18>:
.globl vector18
vector18:
  pushl $0
c01022ca:	6a 00                	push   $0x0
  pushl $18
c01022cc:	6a 12                	push   $0x12
  jmp __alltraps
c01022ce:	e9 d5 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022d3 <vector19>:
.globl vector19
vector19:
  pushl $0
c01022d3:	6a 00                	push   $0x0
  pushl $19
c01022d5:	6a 13                	push   $0x13
  jmp __alltraps
c01022d7:	e9 cc 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022dc <vector20>:
.globl vector20
vector20:
  pushl $0
c01022dc:	6a 00                	push   $0x0
  pushl $20
c01022de:	6a 14                	push   $0x14
  jmp __alltraps
c01022e0:	e9 c3 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022e5 <vector21>:
.globl vector21
vector21:
  pushl $0
c01022e5:	6a 00                	push   $0x0
  pushl $21
c01022e7:	6a 15                	push   $0x15
  jmp __alltraps
c01022e9:	e9 ba 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022ee <vector22>:
.globl vector22
vector22:
  pushl $0
c01022ee:	6a 00                	push   $0x0
  pushl $22
c01022f0:	6a 16                	push   $0x16
  jmp __alltraps
c01022f2:	e9 b1 09 00 00       	jmp    c0102ca8 <__alltraps>

c01022f7 <vector23>:
.globl vector23
vector23:
  pushl $0
c01022f7:	6a 00                	push   $0x0
  pushl $23
c01022f9:	6a 17                	push   $0x17
  jmp __alltraps
c01022fb:	e9 a8 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102300 <vector24>:
.globl vector24
vector24:
  pushl $0
c0102300:	6a 00                	push   $0x0
  pushl $24
c0102302:	6a 18                	push   $0x18
  jmp __alltraps
c0102304:	e9 9f 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102309 <vector25>:
.globl vector25
vector25:
  pushl $0
c0102309:	6a 00                	push   $0x0
  pushl $25
c010230b:	6a 19                	push   $0x19
  jmp __alltraps
c010230d:	e9 96 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102312 <vector26>:
.globl vector26
vector26:
  pushl $0
c0102312:	6a 00                	push   $0x0
  pushl $26
c0102314:	6a 1a                	push   $0x1a
  jmp __alltraps
c0102316:	e9 8d 09 00 00       	jmp    c0102ca8 <__alltraps>

c010231b <vector27>:
.globl vector27
vector27:
  pushl $0
c010231b:	6a 00                	push   $0x0
  pushl $27
c010231d:	6a 1b                	push   $0x1b
  jmp __alltraps
c010231f:	e9 84 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102324 <vector28>:
.globl vector28
vector28:
  pushl $0
c0102324:	6a 00                	push   $0x0
  pushl $28
c0102326:	6a 1c                	push   $0x1c
  jmp __alltraps
c0102328:	e9 7b 09 00 00       	jmp    c0102ca8 <__alltraps>

c010232d <vector29>:
.globl vector29
vector29:
  pushl $0
c010232d:	6a 00                	push   $0x0
  pushl $29
c010232f:	6a 1d                	push   $0x1d
  jmp __alltraps
c0102331:	e9 72 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102336 <vector30>:
.globl vector30
vector30:
  pushl $0
c0102336:	6a 00                	push   $0x0
  pushl $30
c0102338:	6a 1e                	push   $0x1e
  jmp __alltraps
c010233a:	e9 69 09 00 00       	jmp    c0102ca8 <__alltraps>

c010233f <vector31>:
.globl vector31
vector31:
  pushl $0
c010233f:	6a 00                	push   $0x0
  pushl $31
c0102341:	6a 1f                	push   $0x1f
  jmp __alltraps
c0102343:	e9 60 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102348 <vector32>:
.globl vector32
vector32:
  pushl $0
c0102348:	6a 00                	push   $0x0
  pushl $32
c010234a:	6a 20                	push   $0x20
  jmp __alltraps
c010234c:	e9 57 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102351 <vector33>:
.globl vector33
vector33:
  pushl $0
c0102351:	6a 00                	push   $0x0
  pushl $33
c0102353:	6a 21                	push   $0x21
  jmp __alltraps
c0102355:	e9 4e 09 00 00       	jmp    c0102ca8 <__alltraps>

c010235a <vector34>:
.globl vector34
vector34:
  pushl $0
c010235a:	6a 00                	push   $0x0
  pushl $34
c010235c:	6a 22                	push   $0x22
  jmp __alltraps
c010235e:	e9 45 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102363 <vector35>:
.globl vector35
vector35:
  pushl $0
c0102363:	6a 00                	push   $0x0
  pushl $35
c0102365:	6a 23                	push   $0x23
  jmp __alltraps
c0102367:	e9 3c 09 00 00       	jmp    c0102ca8 <__alltraps>

c010236c <vector36>:
.globl vector36
vector36:
  pushl $0
c010236c:	6a 00                	push   $0x0
  pushl $36
c010236e:	6a 24                	push   $0x24
  jmp __alltraps
c0102370:	e9 33 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102375 <vector37>:
.globl vector37
vector37:
  pushl $0
c0102375:	6a 00                	push   $0x0
  pushl $37
c0102377:	6a 25                	push   $0x25
  jmp __alltraps
c0102379:	e9 2a 09 00 00       	jmp    c0102ca8 <__alltraps>

c010237e <vector38>:
.globl vector38
vector38:
  pushl $0
c010237e:	6a 00                	push   $0x0
  pushl $38
c0102380:	6a 26                	push   $0x26
  jmp __alltraps
c0102382:	e9 21 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102387 <vector39>:
.globl vector39
vector39:
  pushl $0
c0102387:	6a 00                	push   $0x0
  pushl $39
c0102389:	6a 27                	push   $0x27
  jmp __alltraps
c010238b:	e9 18 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102390 <vector40>:
.globl vector40
vector40:
  pushl $0
c0102390:	6a 00                	push   $0x0
  pushl $40
c0102392:	6a 28                	push   $0x28
  jmp __alltraps
c0102394:	e9 0f 09 00 00       	jmp    c0102ca8 <__alltraps>

c0102399 <vector41>:
.globl vector41
vector41:
  pushl $0
c0102399:	6a 00                	push   $0x0
  pushl $41
c010239b:	6a 29                	push   $0x29
  jmp __alltraps
c010239d:	e9 06 09 00 00       	jmp    c0102ca8 <__alltraps>

c01023a2 <vector42>:
.globl vector42
vector42:
  pushl $0
c01023a2:	6a 00                	push   $0x0
  pushl $42
c01023a4:	6a 2a                	push   $0x2a
  jmp __alltraps
c01023a6:	e9 fd 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023ab <vector43>:
.globl vector43
vector43:
  pushl $0
c01023ab:	6a 00                	push   $0x0
  pushl $43
c01023ad:	6a 2b                	push   $0x2b
  jmp __alltraps
c01023af:	e9 f4 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023b4 <vector44>:
.globl vector44
vector44:
  pushl $0
c01023b4:	6a 00                	push   $0x0
  pushl $44
c01023b6:	6a 2c                	push   $0x2c
  jmp __alltraps
c01023b8:	e9 eb 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023bd <vector45>:
.globl vector45
vector45:
  pushl $0
c01023bd:	6a 00                	push   $0x0
  pushl $45
c01023bf:	6a 2d                	push   $0x2d
  jmp __alltraps
c01023c1:	e9 e2 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023c6 <vector46>:
.globl vector46
vector46:
  pushl $0
c01023c6:	6a 00                	push   $0x0
  pushl $46
c01023c8:	6a 2e                	push   $0x2e
  jmp __alltraps
c01023ca:	e9 d9 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023cf <vector47>:
.globl vector47
vector47:
  pushl $0
c01023cf:	6a 00                	push   $0x0
  pushl $47
c01023d1:	6a 2f                	push   $0x2f
  jmp __alltraps
c01023d3:	e9 d0 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023d8 <vector48>:
.globl vector48
vector48:
  pushl $0
c01023d8:	6a 00                	push   $0x0
  pushl $48
c01023da:	6a 30                	push   $0x30
  jmp __alltraps
c01023dc:	e9 c7 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023e1 <vector49>:
.globl vector49
vector49:
  pushl $0
c01023e1:	6a 00                	push   $0x0
  pushl $49
c01023e3:	6a 31                	push   $0x31
  jmp __alltraps
c01023e5:	e9 be 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023ea <vector50>:
.globl vector50
vector50:
  pushl $0
c01023ea:	6a 00                	push   $0x0
  pushl $50
c01023ec:	6a 32                	push   $0x32
  jmp __alltraps
c01023ee:	e9 b5 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023f3 <vector51>:
.globl vector51
vector51:
  pushl $0
c01023f3:	6a 00                	push   $0x0
  pushl $51
c01023f5:	6a 33                	push   $0x33
  jmp __alltraps
c01023f7:	e9 ac 08 00 00       	jmp    c0102ca8 <__alltraps>

c01023fc <vector52>:
.globl vector52
vector52:
  pushl $0
c01023fc:	6a 00                	push   $0x0
  pushl $52
c01023fe:	6a 34                	push   $0x34
  jmp __alltraps
c0102400:	e9 a3 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102405 <vector53>:
.globl vector53
vector53:
  pushl $0
c0102405:	6a 00                	push   $0x0
  pushl $53
c0102407:	6a 35                	push   $0x35
  jmp __alltraps
c0102409:	e9 9a 08 00 00       	jmp    c0102ca8 <__alltraps>

c010240e <vector54>:
.globl vector54
vector54:
  pushl $0
c010240e:	6a 00                	push   $0x0
  pushl $54
c0102410:	6a 36                	push   $0x36
  jmp __alltraps
c0102412:	e9 91 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102417 <vector55>:
.globl vector55
vector55:
  pushl $0
c0102417:	6a 00                	push   $0x0
  pushl $55
c0102419:	6a 37                	push   $0x37
  jmp __alltraps
c010241b:	e9 88 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102420 <vector56>:
.globl vector56
vector56:
  pushl $0
c0102420:	6a 00                	push   $0x0
  pushl $56
c0102422:	6a 38                	push   $0x38
  jmp __alltraps
c0102424:	e9 7f 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102429 <vector57>:
.globl vector57
vector57:
  pushl $0
c0102429:	6a 00                	push   $0x0
  pushl $57
c010242b:	6a 39                	push   $0x39
  jmp __alltraps
c010242d:	e9 76 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102432 <vector58>:
.globl vector58
vector58:
  pushl $0
c0102432:	6a 00                	push   $0x0
  pushl $58
c0102434:	6a 3a                	push   $0x3a
  jmp __alltraps
c0102436:	e9 6d 08 00 00       	jmp    c0102ca8 <__alltraps>

c010243b <vector59>:
.globl vector59
vector59:
  pushl $0
c010243b:	6a 00                	push   $0x0
  pushl $59
c010243d:	6a 3b                	push   $0x3b
  jmp __alltraps
c010243f:	e9 64 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102444 <vector60>:
.globl vector60
vector60:
  pushl $0
c0102444:	6a 00                	push   $0x0
  pushl $60
c0102446:	6a 3c                	push   $0x3c
  jmp __alltraps
c0102448:	e9 5b 08 00 00       	jmp    c0102ca8 <__alltraps>

c010244d <vector61>:
.globl vector61
vector61:
  pushl $0
c010244d:	6a 00                	push   $0x0
  pushl $61
c010244f:	6a 3d                	push   $0x3d
  jmp __alltraps
c0102451:	e9 52 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102456 <vector62>:
.globl vector62
vector62:
  pushl $0
c0102456:	6a 00                	push   $0x0
  pushl $62
c0102458:	6a 3e                	push   $0x3e
  jmp __alltraps
c010245a:	e9 49 08 00 00       	jmp    c0102ca8 <__alltraps>

c010245f <vector63>:
.globl vector63
vector63:
  pushl $0
c010245f:	6a 00                	push   $0x0
  pushl $63
c0102461:	6a 3f                	push   $0x3f
  jmp __alltraps
c0102463:	e9 40 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102468 <vector64>:
.globl vector64
vector64:
  pushl $0
c0102468:	6a 00                	push   $0x0
  pushl $64
c010246a:	6a 40                	push   $0x40
  jmp __alltraps
c010246c:	e9 37 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102471 <vector65>:
.globl vector65
vector65:
  pushl $0
c0102471:	6a 00                	push   $0x0
  pushl $65
c0102473:	6a 41                	push   $0x41
  jmp __alltraps
c0102475:	e9 2e 08 00 00       	jmp    c0102ca8 <__alltraps>

c010247a <vector66>:
.globl vector66
vector66:
  pushl $0
c010247a:	6a 00                	push   $0x0
  pushl $66
c010247c:	6a 42                	push   $0x42
  jmp __alltraps
c010247e:	e9 25 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102483 <vector67>:
.globl vector67
vector67:
  pushl $0
c0102483:	6a 00                	push   $0x0
  pushl $67
c0102485:	6a 43                	push   $0x43
  jmp __alltraps
c0102487:	e9 1c 08 00 00       	jmp    c0102ca8 <__alltraps>

c010248c <vector68>:
.globl vector68
vector68:
  pushl $0
c010248c:	6a 00                	push   $0x0
  pushl $68
c010248e:	6a 44                	push   $0x44
  jmp __alltraps
c0102490:	e9 13 08 00 00       	jmp    c0102ca8 <__alltraps>

c0102495 <vector69>:
.globl vector69
vector69:
  pushl $0
c0102495:	6a 00                	push   $0x0
  pushl $69
c0102497:	6a 45                	push   $0x45
  jmp __alltraps
c0102499:	e9 0a 08 00 00       	jmp    c0102ca8 <__alltraps>

c010249e <vector70>:
.globl vector70
vector70:
  pushl $0
c010249e:	6a 00                	push   $0x0
  pushl $70
c01024a0:	6a 46                	push   $0x46
  jmp __alltraps
c01024a2:	e9 01 08 00 00       	jmp    c0102ca8 <__alltraps>

c01024a7 <vector71>:
.globl vector71
vector71:
  pushl $0
c01024a7:	6a 00                	push   $0x0
  pushl $71
c01024a9:	6a 47                	push   $0x47
  jmp __alltraps
c01024ab:	e9 f8 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024b0 <vector72>:
.globl vector72
vector72:
  pushl $0
c01024b0:	6a 00                	push   $0x0
  pushl $72
c01024b2:	6a 48                	push   $0x48
  jmp __alltraps
c01024b4:	e9 ef 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024b9 <vector73>:
.globl vector73
vector73:
  pushl $0
c01024b9:	6a 00                	push   $0x0
  pushl $73
c01024bb:	6a 49                	push   $0x49
  jmp __alltraps
c01024bd:	e9 e6 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024c2 <vector74>:
.globl vector74
vector74:
  pushl $0
c01024c2:	6a 00                	push   $0x0
  pushl $74
c01024c4:	6a 4a                	push   $0x4a
  jmp __alltraps
c01024c6:	e9 dd 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024cb <vector75>:
.globl vector75
vector75:
  pushl $0
c01024cb:	6a 00                	push   $0x0
  pushl $75
c01024cd:	6a 4b                	push   $0x4b
  jmp __alltraps
c01024cf:	e9 d4 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024d4 <vector76>:
.globl vector76
vector76:
  pushl $0
c01024d4:	6a 00                	push   $0x0
  pushl $76
c01024d6:	6a 4c                	push   $0x4c
  jmp __alltraps
c01024d8:	e9 cb 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024dd <vector77>:
.globl vector77
vector77:
  pushl $0
c01024dd:	6a 00                	push   $0x0
  pushl $77
c01024df:	6a 4d                	push   $0x4d
  jmp __alltraps
c01024e1:	e9 c2 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024e6 <vector78>:
.globl vector78
vector78:
  pushl $0
c01024e6:	6a 00                	push   $0x0
  pushl $78
c01024e8:	6a 4e                	push   $0x4e
  jmp __alltraps
c01024ea:	e9 b9 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024ef <vector79>:
.globl vector79
vector79:
  pushl $0
c01024ef:	6a 00                	push   $0x0
  pushl $79
c01024f1:	6a 4f                	push   $0x4f
  jmp __alltraps
c01024f3:	e9 b0 07 00 00       	jmp    c0102ca8 <__alltraps>

c01024f8 <vector80>:
.globl vector80
vector80:
  pushl $0
c01024f8:	6a 00                	push   $0x0
  pushl $80
c01024fa:	6a 50                	push   $0x50
  jmp __alltraps
c01024fc:	e9 a7 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102501 <vector81>:
.globl vector81
vector81:
  pushl $0
c0102501:	6a 00                	push   $0x0
  pushl $81
c0102503:	6a 51                	push   $0x51
  jmp __alltraps
c0102505:	e9 9e 07 00 00       	jmp    c0102ca8 <__alltraps>

c010250a <vector82>:
.globl vector82
vector82:
  pushl $0
c010250a:	6a 00                	push   $0x0
  pushl $82
c010250c:	6a 52                	push   $0x52
  jmp __alltraps
c010250e:	e9 95 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102513 <vector83>:
.globl vector83
vector83:
  pushl $0
c0102513:	6a 00                	push   $0x0
  pushl $83
c0102515:	6a 53                	push   $0x53
  jmp __alltraps
c0102517:	e9 8c 07 00 00       	jmp    c0102ca8 <__alltraps>

c010251c <vector84>:
.globl vector84
vector84:
  pushl $0
c010251c:	6a 00                	push   $0x0
  pushl $84
c010251e:	6a 54                	push   $0x54
  jmp __alltraps
c0102520:	e9 83 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102525 <vector85>:
.globl vector85
vector85:
  pushl $0
c0102525:	6a 00                	push   $0x0
  pushl $85
c0102527:	6a 55                	push   $0x55
  jmp __alltraps
c0102529:	e9 7a 07 00 00       	jmp    c0102ca8 <__alltraps>

c010252e <vector86>:
.globl vector86
vector86:
  pushl $0
c010252e:	6a 00                	push   $0x0
  pushl $86
c0102530:	6a 56                	push   $0x56
  jmp __alltraps
c0102532:	e9 71 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102537 <vector87>:
.globl vector87
vector87:
  pushl $0
c0102537:	6a 00                	push   $0x0
  pushl $87
c0102539:	6a 57                	push   $0x57
  jmp __alltraps
c010253b:	e9 68 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102540 <vector88>:
.globl vector88
vector88:
  pushl $0
c0102540:	6a 00                	push   $0x0
  pushl $88
c0102542:	6a 58                	push   $0x58
  jmp __alltraps
c0102544:	e9 5f 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102549 <vector89>:
.globl vector89
vector89:
  pushl $0
c0102549:	6a 00                	push   $0x0
  pushl $89
c010254b:	6a 59                	push   $0x59
  jmp __alltraps
c010254d:	e9 56 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102552 <vector90>:
.globl vector90
vector90:
  pushl $0
c0102552:	6a 00                	push   $0x0
  pushl $90
c0102554:	6a 5a                	push   $0x5a
  jmp __alltraps
c0102556:	e9 4d 07 00 00       	jmp    c0102ca8 <__alltraps>

c010255b <vector91>:
.globl vector91
vector91:
  pushl $0
c010255b:	6a 00                	push   $0x0
  pushl $91
c010255d:	6a 5b                	push   $0x5b
  jmp __alltraps
c010255f:	e9 44 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102564 <vector92>:
.globl vector92
vector92:
  pushl $0
c0102564:	6a 00                	push   $0x0
  pushl $92
c0102566:	6a 5c                	push   $0x5c
  jmp __alltraps
c0102568:	e9 3b 07 00 00       	jmp    c0102ca8 <__alltraps>

c010256d <vector93>:
.globl vector93
vector93:
  pushl $0
c010256d:	6a 00                	push   $0x0
  pushl $93
c010256f:	6a 5d                	push   $0x5d
  jmp __alltraps
c0102571:	e9 32 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102576 <vector94>:
.globl vector94
vector94:
  pushl $0
c0102576:	6a 00                	push   $0x0
  pushl $94
c0102578:	6a 5e                	push   $0x5e
  jmp __alltraps
c010257a:	e9 29 07 00 00       	jmp    c0102ca8 <__alltraps>

c010257f <vector95>:
.globl vector95
vector95:
  pushl $0
c010257f:	6a 00                	push   $0x0
  pushl $95
c0102581:	6a 5f                	push   $0x5f
  jmp __alltraps
c0102583:	e9 20 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102588 <vector96>:
.globl vector96
vector96:
  pushl $0
c0102588:	6a 00                	push   $0x0
  pushl $96
c010258a:	6a 60                	push   $0x60
  jmp __alltraps
c010258c:	e9 17 07 00 00       	jmp    c0102ca8 <__alltraps>

c0102591 <vector97>:
.globl vector97
vector97:
  pushl $0
c0102591:	6a 00                	push   $0x0
  pushl $97
c0102593:	6a 61                	push   $0x61
  jmp __alltraps
c0102595:	e9 0e 07 00 00       	jmp    c0102ca8 <__alltraps>

c010259a <vector98>:
.globl vector98
vector98:
  pushl $0
c010259a:	6a 00                	push   $0x0
  pushl $98
c010259c:	6a 62                	push   $0x62
  jmp __alltraps
c010259e:	e9 05 07 00 00       	jmp    c0102ca8 <__alltraps>

c01025a3 <vector99>:
.globl vector99
vector99:
  pushl $0
c01025a3:	6a 00                	push   $0x0
  pushl $99
c01025a5:	6a 63                	push   $0x63
  jmp __alltraps
c01025a7:	e9 fc 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025ac <vector100>:
.globl vector100
vector100:
  pushl $0
c01025ac:	6a 00                	push   $0x0
  pushl $100
c01025ae:	6a 64                	push   $0x64
  jmp __alltraps
c01025b0:	e9 f3 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025b5 <vector101>:
.globl vector101
vector101:
  pushl $0
c01025b5:	6a 00                	push   $0x0
  pushl $101
c01025b7:	6a 65                	push   $0x65
  jmp __alltraps
c01025b9:	e9 ea 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025be <vector102>:
.globl vector102
vector102:
  pushl $0
c01025be:	6a 00                	push   $0x0
  pushl $102
c01025c0:	6a 66                	push   $0x66
  jmp __alltraps
c01025c2:	e9 e1 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025c7 <vector103>:
.globl vector103
vector103:
  pushl $0
c01025c7:	6a 00                	push   $0x0
  pushl $103
c01025c9:	6a 67                	push   $0x67
  jmp __alltraps
c01025cb:	e9 d8 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025d0 <vector104>:
.globl vector104
vector104:
  pushl $0
c01025d0:	6a 00                	push   $0x0
  pushl $104
c01025d2:	6a 68                	push   $0x68
  jmp __alltraps
c01025d4:	e9 cf 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025d9 <vector105>:
.globl vector105
vector105:
  pushl $0
c01025d9:	6a 00                	push   $0x0
  pushl $105
c01025db:	6a 69                	push   $0x69
  jmp __alltraps
c01025dd:	e9 c6 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025e2 <vector106>:
.globl vector106
vector106:
  pushl $0
c01025e2:	6a 00                	push   $0x0
  pushl $106
c01025e4:	6a 6a                	push   $0x6a
  jmp __alltraps
c01025e6:	e9 bd 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025eb <vector107>:
.globl vector107
vector107:
  pushl $0
c01025eb:	6a 00                	push   $0x0
  pushl $107
c01025ed:	6a 6b                	push   $0x6b
  jmp __alltraps
c01025ef:	e9 b4 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025f4 <vector108>:
.globl vector108
vector108:
  pushl $0
c01025f4:	6a 00                	push   $0x0
  pushl $108
c01025f6:	6a 6c                	push   $0x6c
  jmp __alltraps
c01025f8:	e9 ab 06 00 00       	jmp    c0102ca8 <__alltraps>

c01025fd <vector109>:
.globl vector109
vector109:
  pushl $0
c01025fd:	6a 00                	push   $0x0
  pushl $109
c01025ff:	6a 6d                	push   $0x6d
  jmp __alltraps
c0102601:	e9 a2 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102606 <vector110>:
.globl vector110
vector110:
  pushl $0
c0102606:	6a 00                	push   $0x0
  pushl $110
c0102608:	6a 6e                	push   $0x6e
  jmp __alltraps
c010260a:	e9 99 06 00 00       	jmp    c0102ca8 <__alltraps>

c010260f <vector111>:
.globl vector111
vector111:
  pushl $0
c010260f:	6a 00                	push   $0x0
  pushl $111
c0102611:	6a 6f                	push   $0x6f
  jmp __alltraps
c0102613:	e9 90 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102618 <vector112>:
.globl vector112
vector112:
  pushl $0
c0102618:	6a 00                	push   $0x0
  pushl $112
c010261a:	6a 70                	push   $0x70
  jmp __alltraps
c010261c:	e9 87 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102621 <vector113>:
.globl vector113
vector113:
  pushl $0
c0102621:	6a 00                	push   $0x0
  pushl $113
c0102623:	6a 71                	push   $0x71
  jmp __alltraps
c0102625:	e9 7e 06 00 00       	jmp    c0102ca8 <__alltraps>

c010262a <vector114>:
.globl vector114
vector114:
  pushl $0
c010262a:	6a 00                	push   $0x0
  pushl $114
c010262c:	6a 72                	push   $0x72
  jmp __alltraps
c010262e:	e9 75 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102633 <vector115>:
.globl vector115
vector115:
  pushl $0
c0102633:	6a 00                	push   $0x0
  pushl $115
c0102635:	6a 73                	push   $0x73
  jmp __alltraps
c0102637:	e9 6c 06 00 00       	jmp    c0102ca8 <__alltraps>

c010263c <vector116>:
.globl vector116
vector116:
  pushl $0
c010263c:	6a 00                	push   $0x0
  pushl $116
c010263e:	6a 74                	push   $0x74
  jmp __alltraps
c0102640:	e9 63 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102645 <vector117>:
.globl vector117
vector117:
  pushl $0
c0102645:	6a 00                	push   $0x0
  pushl $117
c0102647:	6a 75                	push   $0x75
  jmp __alltraps
c0102649:	e9 5a 06 00 00       	jmp    c0102ca8 <__alltraps>

c010264e <vector118>:
.globl vector118
vector118:
  pushl $0
c010264e:	6a 00                	push   $0x0
  pushl $118
c0102650:	6a 76                	push   $0x76
  jmp __alltraps
c0102652:	e9 51 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102657 <vector119>:
.globl vector119
vector119:
  pushl $0
c0102657:	6a 00                	push   $0x0
  pushl $119
c0102659:	6a 77                	push   $0x77
  jmp __alltraps
c010265b:	e9 48 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102660 <vector120>:
.globl vector120
vector120:
  pushl $0
c0102660:	6a 00                	push   $0x0
  pushl $120
c0102662:	6a 78                	push   $0x78
  jmp __alltraps
c0102664:	e9 3f 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102669 <vector121>:
.globl vector121
vector121:
  pushl $0
c0102669:	6a 00                	push   $0x0
  pushl $121
c010266b:	6a 79                	push   $0x79
  jmp __alltraps
c010266d:	e9 36 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102672 <vector122>:
.globl vector122
vector122:
  pushl $0
c0102672:	6a 00                	push   $0x0
  pushl $122
c0102674:	6a 7a                	push   $0x7a
  jmp __alltraps
c0102676:	e9 2d 06 00 00       	jmp    c0102ca8 <__alltraps>

c010267b <vector123>:
.globl vector123
vector123:
  pushl $0
c010267b:	6a 00                	push   $0x0
  pushl $123
c010267d:	6a 7b                	push   $0x7b
  jmp __alltraps
c010267f:	e9 24 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102684 <vector124>:
.globl vector124
vector124:
  pushl $0
c0102684:	6a 00                	push   $0x0
  pushl $124
c0102686:	6a 7c                	push   $0x7c
  jmp __alltraps
c0102688:	e9 1b 06 00 00       	jmp    c0102ca8 <__alltraps>

c010268d <vector125>:
.globl vector125
vector125:
  pushl $0
c010268d:	6a 00                	push   $0x0
  pushl $125
c010268f:	6a 7d                	push   $0x7d
  jmp __alltraps
c0102691:	e9 12 06 00 00       	jmp    c0102ca8 <__alltraps>

c0102696 <vector126>:
.globl vector126
vector126:
  pushl $0
c0102696:	6a 00                	push   $0x0
  pushl $126
c0102698:	6a 7e                	push   $0x7e
  jmp __alltraps
c010269a:	e9 09 06 00 00       	jmp    c0102ca8 <__alltraps>

c010269f <vector127>:
.globl vector127
vector127:
  pushl $0
c010269f:	6a 00                	push   $0x0
  pushl $127
c01026a1:	6a 7f                	push   $0x7f
  jmp __alltraps
c01026a3:	e9 00 06 00 00       	jmp    c0102ca8 <__alltraps>

c01026a8 <vector128>:
.globl vector128
vector128:
  pushl $0
c01026a8:	6a 00                	push   $0x0
  pushl $128
c01026aa:	68 80 00 00 00       	push   $0x80
  jmp __alltraps
c01026af:	e9 f4 05 00 00       	jmp    c0102ca8 <__alltraps>

c01026b4 <vector129>:
.globl vector129
vector129:
  pushl $0
c01026b4:	6a 00                	push   $0x0
  pushl $129
c01026b6:	68 81 00 00 00       	push   $0x81
  jmp __alltraps
c01026bb:	e9 e8 05 00 00       	jmp    c0102ca8 <__alltraps>

c01026c0 <vector130>:
.globl vector130
vector130:
  pushl $0
c01026c0:	6a 00                	push   $0x0
  pushl $130
c01026c2:	68 82 00 00 00       	push   $0x82
  jmp __alltraps
c01026c7:	e9 dc 05 00 00       	jmp    c0102ca8 <__alltraps>

c01026cc <vector131>:
.globl vector131
vector131:
  pushl $0
c01026cc:	6a 00                	push   $0x0
  pushl $131
c01026ce:	68 83 00 00 00       	push   $0x83
  jmp __alltraps
c01026d3:	e9 d0 05 00 00       	jmp    c0102ca8 <__alltraps>

c01026d8 <vector132>:
.globl vector132
vector132:
  pushl $0
c01026d8:	6a 00                	push   $0x0
  pushl $132
c01026da:	68 84 00 00 00       	push   $0x84
  jmp __alltraps
c01026df:	e9 c4 05 00 00       	jmp    c0102ca8 <__alltraps>

c01026e4 <vector133>:
.globl vector133
vector133:
  pushl $0
c01026e4:	6a 00                	push   $0x0
  pushl $133
c01026e6:	68 85 00 00 00       	push   $0x85
  jmp __alltraps
c01026eb:	e9 b8 05 00 00       	jmp    c0102ca8 <__alltraps>

c01026f0 <vector134>:
.globl vector134
vector134:
  pushl $0
c01026f0:	6a 00                	push   $0x0
  pushl $134
c01026f2:	68 86 00 00 00       	push   $0x86
  jmp __alltraps
c01026f7:	e9 ac 05 00 00       	jmp    c0102ca8 <__alltraps>

c01026fc <vector135>:
.globl vector135
vector135:
  pushl $0
c01026fc:	6a 00                	push   $0x0
  pushl $135
c01026fe:	68 87 00 00 00       	push   $0x87
  jmp __alltraps
c0102703:	e9 a0 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102708 <vector136>:
.globl vector136
vector136:
  pushl $0
c0102708:	6a 00                	push   $0x0
  pushl $136
c010270a:	68 88 00 00 00       	push   $0x88
  jmp __alltraps
c010270f:	e9 94 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102714 <vector137>:
.globl vector137
vector137:
  pushl $0
c0102714:	6a 00                	push   $0x0
  pushl $137
c0102716:	68 89 00 00 00       	push   $0x89
  jmp __alltraps
c010271b:	e9 88 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102720 <vector138>:
.globl vector138
vector138:
  pushl $0
c0102720:	6a 00                	push   $0x0
  pushl $138
c0102722:	68 8a 00 00 00       	push   $0x8a
  jmp __alltraps
c0102727:	e9 7c 05 00 00       	jmp    c0102ca8 <__alltraps>

c010272c <vector139>:
.globl vector139
vector139:
  pushl $0
c010272c:	6a 00                	push   $0x0
  pushl $139
c010272e:	68 8b 00 00 00       	push   $0x8b
  jmp __alltraps
c0102733:	e9 70 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102738 <vector140>:
.globl vector140
vector140:
  pushl $0
c0102738:	6a 00                	push   $0x0
  pushl $140
c010273a:	68 8c 00 00 00       	push   $0x8c
  jmp __alltraps
c010273f:	e9 64 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102744 <vector141>:
.globl vector141
vector141:
  pushl $0
c0102744:	6a 00                	push   $0x0
  pushl $141
c0102746:	68 8d 00 00 00       	push   $0x8d
  jmp __alltraps
c010274b:	e9 58 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102750 <vector142>:
.globl vector142
vector142:
  pushl $0
c0102750:	6a 00                	push   $0x0
  pushl $142
c0102752:	68 8e 00 00 00       	push   $0x8e
  jmp __alltraps
c0102757:	e9 4c 05 00 00       	jmp    c0102ca8 <__alltraps>

c010275c <vector143>:
.globl vector143
vector143:
  pushl $0
c010275c:	6a 00                	push   $0x0
  pushl $143
c010275e:	68 8f 00 00 00       	push   $0x8f
  jmp __alltraps
c0102763:	e9 40 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102768 <vector144>:
.globl vector144
vector144:
  pushl $0
c0102768:	6a 00                	push   $0x0
  pushl $144
c010276a:	68 90 00 00 00       	push   $0x90
  jmp __alltraps
c010276f:	e9 34 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102774 <vector145>:
.globl vector145
vector145:
  pushl $0
c0102774:	6a 00                	push   $0x0
  pushl $145
c0102776:	68 91 00 00 00       	push   $0x91
  jmp __alltraps
c010277b:	e9 28 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102780 <vector146>:
.globl vector146
vector146:
  pushl $0
c0102780:	6a 00                	push   $0x0
  pushl $146
c0102782:	68 92 00 00 00       	push   $0x92
  jmp __alltraps
c0102787:	e9 1c 05 00 00       	jmp    c0102ca8 <__alltraps>

c010278c <vector147>:
.globl vector147
vector147:
  pushl $0
c010278c:	6a 00                	push   $0x0
  pushl $147
c010278e:	68 93 00 00 00       	push   $0x93
  jmp __alltraps
c0102793:	e9 10 05 00 00       	jmp    c0102ca8 <__alltraps>

c0102798 <vector148>:
.globl vector148
vector148:
  pushl $0
c0102798:	6a 00                	push   $0x0
  pushl $148
c010279a:	68 94 00 00 00       	push   $0x94
  jmp __alltraps
c010279f:	e9 04 05 00 00       	jmp    c0102ca8 <__alltraps>

c01027a4 <vector149>:
.globl vector149
vector149:
  pushl $0
c01027a4:	6a 00                	push   $0x0
  pushl $149
c01027a6:	68 95 00 00 00       	push   $0x95
  jmp __alltraps
c01027ab:	e9 f8 04 00 00       	jmp    c0102ca8 <__alltraps>

c01027b0 <vector150>:
.globl vector150
vector150:
  pushl $0
c01027b0:	6a 00                	push   $0x0
  pushl $150
c01027b2:	68 96 00 00 00       	push   $0x96
  jmp __alltraps
c01027b7:	e9 ec 04 00 00       	jmp    c0102ca8 <__alltraps>

c01027bc <vector151>:
.globl vector151
vector151:
  pushl $0
c01027bc:	6a 00                	push   $0x0
  pushl $151
c01027be:	68 97 00 00 00       	push   $0x97
  jmp __alltraps
c01027c3:	e9 e0 04 00 00       	jmp    c0102ca8 <__alltraps>

c01027c8 <vector152>:
.globl vector152
vector152:
  pushl $0
c01027c8:	6a 00                	push   $0x0
  pushl $152
c01027ca:	68 98 00 00 00       	push   $0x98
  jmp __alltraps
c01027cf:	e9 d4 04 00 00       	jmp    c0102ca8 <__alltraps>

c01027d4 <vector153>:
.globl vector153
vector153:
  pushl $0
c01027d4:	6a 00                	push   $0x0
  pushl $153
c01027d6:	68 99 00 00 00       	push   $0x99
  jmp __alltraps
c01027db:	e9 c8 04 00 00       	jmp    c0102ca8 <__alltraps>

c01027e0 <vector154>:
.globl vector154
vector154:
  pushl $0
c01027e0:	6a 00                	push   $0x0
  pushl $154
c01027e2:	68 9a 00 00 00       	push   $0x9a
  jmp __alltraps
c01027e7:	e9 bc 04 00 00       	jmp    c0102ca8 <__alltraps>

c01027ec <vector155>:
.globl vector155
vector155:
  pushl $0
c01027ec:	6a 00                	push   $0x0
  pushl $155
c01027ee:	68 9b 00 00 00       	push   $0x9b
  jmp __alltraps
c01027f3:	e9 b0 04 00 00       	jmp    c0102ca8 <__alltraps>

c01027f8 <vector156>:
.globl vector156
vector156:
  pushl $0
c01027f8:	6a 00                	push   $0x0
  pushl $156
c01027fa:	68 9c 00 00 00       	push   $0x9c
  jmp __alltraps
c01027ff:	e9 a4 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102804 <vector157>:
.globl vector157
vector157:
  pushl $0
c0102804:	6a 00                	push   $0x0
  pushl $157
c0102806:	68 9d 00 00 00       	push   $0x9d
  jmp __alltraps
c010280b:	e9 98 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102810 <vector158>:
.globl vector158
vector158:
  pushl $0
c0102810:	6a 00                	push   $0x0
  pushl $158
c0102812:	68 9e 00 00 00       	push   $0x9e
  jmp __alltraps
c0102817:	e9 8c 04 00 00       	jmp    c0102ca8 <__alltraps>

c010281c <vector159>:
.globl vector159
vector159:
  pushl $0
c010281c:	6a 00                	push   $0x0
  pushl $159
c010281e:	68 9f 00 00 00       	push   $0x9f
  jmp __alltraps
c0102823:	e9 80 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102828 <vector160>:
.globl vector160
vector160:
  pushl $0
c0102828:	6a 00                	push   $0x0
  pushl $160
c010282a:	68 a0 00 00 00       	push   $0xa0
  jmp __alltraps
c010282f:	e9 74 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102834 <vector161>:
.globl vector161
vector161:
  pushl $0
c0102834:	6a 00                	push   $0x0
  pushl $161
c0102836:	68 a1 00 00 00       	push   $0xa1
  jmp __alltraps
c010283b:	e9 68 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102840 <vector162>:
.globl vector162
vector162:
  pushl $0
c0102840:	6a 00                	push   $0x0
  pushl $162
c0102842:	68 a2 00 00 00       	push   $0xa2
  jmp __alltraps
c0102847:	e9 5c 04 00 00       	jmp    c0102ca8 <__alltraps>

c010284c <vector163>:
.globl vector163
vector163:
  pushl $0
c010284c:	6a 00                	push   $0x0
  pushl $163
c010284e:	68 a3 00 00 00       	push   $0xa3
  jmp __alltraps
c0102853:	e9 50 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102858 <vector164>:
.globl vector164
vector164:
  pushl $0
c0102858:	6a 00                	push   $0x0
  pushl $164
c010285a:	68 a4 00 00 00       	push   $0xa4
  jmp __alltraps
c010285f:	e9 44 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102864 <vector165>:
.globl vector165
vector165:
  pushl $0
c0102864:	6a 00                	push   $0x0
  pushl $165
c0102866:	68 a5 00 00 00       	push   $0xa5
  jmp __alltraps
c010286b:	e9 38 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102870 <vector166>:
.globl vector166
vector166:
  pushl $0
c0102870:	6a 00                	push   $0x0
  pushl $166
c0102872:	68 a6 00 00 00       	push   $0xa6
  jmp __alltraps
c0102877:	e9 2c 04 00 00       	jmp    c0102ca8 <__alltraps>

c010287c <vector167>:
.globl vector167
vector167:
  pushl $0
c010287c:	6a 00                	push   $0x0
  pushl $167
c010287e:	68 a7 00 00 00       	push   $0xa7
  jmp __alltraps
c0102883:	e9 20 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102888 <vector168>:
.globl vector168
vector168:
  pushl $0
c0102888:	6a 00                	push   $0x0
  pushl $168
c010288a:	68 a8 00 00 00       	push   $0xa8
  jmp __alltraps
c010288f:	e9 14 04 00 00       	jmp    c0102ca8 <__alltraps>

c0102894 <vector169>:
.globl vector169
vector169:
  pushl $0
c0102894:	6a 00                	push   $0x0
  pushl $169
c0102896:	68 a9 00 00 00       	push   $0xa9
  jmp __alltraps
c010289b:	e9 08 04 00 00       	jmp    c0102ca8 <__alltraps>

c01028a0 <vector170>:
.globl vector170
vector170:
  pushl $0
c01028a0:	6a 00                	push   $0x0
  pushl $170
c01028a2:	68 aa 00 00 00       	push   $0xaa
  jmp __alltraps
c01028a7:	e9 fc 03 00 00       	jmp    c0102ca8 <__alltraps>

c01028ac <vector171>:
.globl vector171
vector171:
  pushl $0
c01028ac:	6a 00                	push   $0x0
  pushl $171
c01028ae:	68 ab 00 00 00       	push   $0xab
  jmp __alltraps
c01028b3:	e9 f0 03 00 00       	jmp    c0102ca8 <__alltraps>

c01028b8 <vector172>:
.globl vector172
vector172:
  pushl $0
c01028b8:	6a 00                	push   $0x0
  pushl $172
c01028ba:	68 ac 00 00 00       	push   $0xac
  jmp __alltraps
c01028bf:	e9 e4 03 00 00       	jmp    c0102ca8 <__alltraps>

c01028c4 <vector173>:
.globl vector173
vector173:
  pushl $0
c01028c4:	6a 00                	push   $0x0
  pushl $173
c01028c6:	68 ad 00 00 00       	push   $0xad
  jmp __alltraps
c01028cb:	e9 d8 03 00 00       	jmp    c0102ca8 <__alltraps>

c01028d0 <vector174>:
.globl vector174
vector174:
  pushl $0
c01028d0:	6a 00                	push   $0x0
  pushl $174
c01028d2:	68 ae 00 00 00       	push   $0xae
  jmp __alltraps
c01028d7:	e9 cc 03 00 00       	jmp    c0102ca8 <__alltraps>

c01028dc <vector175>:
.globl vector175
vector175:
  pushl $0
c01028dc:	6a 00                	push   $0x0
  pushl $175
c01028de:	68 af 00 00 00       	push   $0xaf
  jmp __alltraps
c01028e3:	e9 c0 03 00 00       	jmp    c0102ca8 <__alltraps>

c01028e8 <vector176>:
.globl vector176
vector176:
  pushl $0
c01028e8:	6a 00                	push   $0x0
  pushl $176
c01028ea:	68 b0 00 00 00       	push   $0xb0
  jmp __alltraps
c01028ef:	e9 b4 03 00 00       	jmp    c0102ca8 <__alltraps>

c01028f4 <vector177>:
.globl vector177
vector177:
  pushl $0
c01028f4:	6a 00                	push   $0x0
  pushl $177
c01028f6:	68 b1 00 00 00       	push   $0xb1
  jmp __alltraps
c01028fb:	e9 a8 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102900 <vector178>:
.globl vector178
vector178:
  pushl $0
c0102900:	6a 00                	push   $0x0
  pushl $178
c0102902:	68 b2 00 00 00       	push   $0xb2
  jmp __alltraps
c0102907:	e9 9c 03 00 00       	jmp    c0102ca8 <__alltraps>

c010290c <vector179>:
.globl vector179
vector179:
  pushl $0
c010290c:	6a 00                	push   $0x0
  pushl $179
c010290e:	68 b3 00 00 00       	push   $0xb3
  jmp __alltraps
c0102913:	e9 90 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102918 <vector180>:
.globl vector180
vector180:
  pushl $0
c0102918:	6a 00                	push   $0x0
  pushl $180
c010291a:	68 b4 00 00 00       	push   $0xb4
  jmp __alltraps
c010291f:	e9 84 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102924 <vector181>:
.globl vector181
vector181:
  pushl $0
c0102924:	6a 00                	push   $0x0
  pushl $181
c0102926:	68 b5 00 00 00       	push   $0xb5
  jmp __alltraps
c010292b:	e9 78 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102930 <vector182>:
.globl vector182
vector182:
  pushl $0
c0102930:	6a 00                	push   $0x0
  pushl $182
c0102932:	68 b6 00 00 00       	push   $0xb6
  jmp __alltraps
c0102937:	e9 6c 03 00 00       	jmp    c0102ca8 <__alltraps>

c010293c <vector183>:
.globl vector183
vector183:
  pushl $0
c010293c:	6a 00                	push   $0x0
  pushl $183
c010293e:	68 b7 00 00 00       	push   $0xb7
  jmp __alltraps
c0102943:	e9 60 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102948 <vector184>:
.globl vector184
vector184:
  pushl $0
c0102948:	6a 00                	push   $0x0
  pushl $184
c010294a:	68 b8 00 00 00       	push   $0xb8
  jmp __alltraps
c010294f:	e9 54 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102954 <vector185>:
.globl vector185
vector185:
  pushl $0
c0102954:	6a 00                	push   $0x0
  pushl $185
c0102956:	68 b9 00 00 00       	push   $0xb9
  jmp __alltraps
c010295b:	e9 48 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102960 <vector186>:
.globl vector186
vector186:
  pushl $0
c0102960:	6a 00                	push   $0x0
  pushl $186
c0102962:	68 ba 00 00 00       	push   $0xba
  jmp __alltraps
c0102967:	e9 3c 03 00 00       	jmp    c0102ca8 <__alltraps>

c010296c <vector187>:
.globl vector187
vector187:
  pushl $0
c010296c:	6a 00                	push   $0x0
  pushl $187
c010296e:	68 bb 00 00 00       	push   $0xbb
  jmp __alltraps
c0102973:	e9 30 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102978 <vector188>:
.globl vector188
vector188:
  pushl $0
c0102978:	6a 00                	push   $0x0
  pushl $188
c010297a:	68 bc 00 00 00       	push   $0xbc
  jmp __alltraps
c010297f:	e9 24 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102984 <vector189>:
.globl vector189
vector189:
  pushl $0
c0102984:	6a 00                	push   $0x0
  pushl $189
c0102986:	68 bd 00 00 00       	push   $0xbd
  jmp __alltraps
c010298b:	e9 18 03 00 00       	jmp    c0102ca8 <__alltraps>

c0102990 <vector190>:
.globl vector190
vector190:
  pushl $0
c0102990:	6a 00                	push   $0x0
  pushl $190
c0102992:	68 be 00 00 00       	push   $0xbe
  jmp __alltraps
c0102997:	e9 0c 03 00 00       	jmp    c0102ca8 <__alltraps>

c010299c <vector191>:
.globl vector191
vector191:
  pushl $0
c010299c:	6a 00                	push   $0x0
  pushl $191
c010299e:	68 bf 00 00 00       	push   $0xbf
  jmp __alltraps
c01029a3:	e9 00 03 00 00       	jmp    c0102ca8 <__alltraps>

c01029a8 <vector192>:
.globl vector192
vector192:
  pushl $0
c01029a8:	6a 00                	push   $0x0
  pushl $192
c01029aa:	68 c0 00 00 00       	push   $0xc0
  jmp __alltraps
c01029af:	e9 f4 02 00 00       	jmp    c0102ca8 <__alltraps>

c01029b4 <vector193>:
.globl vector193
vector193:
  pushl $0
c01029b4:	6a 00                	push   $0x0
  pushl $193
c01029b6:	68 c1 00 00 00       	push   $0xc1
  jmp __alltraps
c01029bb:	e9 e8 02 00 00       	jmp    c0102ca8 <__alltraps>

c01029c0 <vector194>:
.globl vector194
vector194:
  pushl $0
c01029c0:	6a 00                	push   $0x0
  pushl $194
c01029c2:	68 c2 00 00 00       	push   $0xc2
  jmp __alltraps
c01029c7:	e9 dc 02 00 00       	jmp    c0102ca8 <__alltraps>

c01029cc <vector195>:
.globl vector195
vector195:
  pushl $0
c01029cc:	6a 00                	push   $0x0
  pushl $195
c01029ce:	68 c3 00 00 00       	push   $0xc3
  jmp __alltraps
c01029d3:	e9 d0 02 00 00       	jmp    c0102ca8 <__alltraps>

c01029d8 <vector196>:
.globl vector196
vector196:
  pushl $0
c01029d8:	6a 00                	push   $0x0
  pushl $196
c01029da:	68 c4 00 00 00       	push   $0xc4
  jmp __alltraps
c01029df:	e9 c4 02 00 00       	jmp    c0102ca8 <__alltraps>

c01029e4 <vector197>:
.globl vector197
vector197:
  pushl $0
c01029e4:	6a 00                	push   $0x0
  pushl $197
c01029e6:	68 c5 00 00 00       	push   $0xc5
  jmp __alltraps
c01029eb:	e9 b8 02 00 00       	jmp    c0102ca8 <__alltraps>

c01029f0 <vector198>:
.globl vector198
vector198:
  pushl $0
c01029f0:	6a 00                	push   $0x0
  pushl $198
c01029f2:	68 c6 00 00 00       	push   $0xc6
  jmp __alltraps
c01029f7:	e9 ac 02 00 00       	jmp    c0102ca8 <__alltraps>

c01029fc <vector199>:
.globl vector199
vector199:
  pushl $0
c01029fc:	6a 00                	push   $0x0
  pushl $199
c01029fe:	68 c7 00 00 00       	push   $0xc7
  jmp __alltraps
c0102a03:	e9 a0 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a08 <vector200>:
.globl vector200
vector200:
  pushl $0
c0102a08:	6a 00                	push   $0x0
  pushl $200
c0102a0a:	68 c8 00 00 00       	push   $0xc8
  jmp __alltraps
c0102a0f:	e9 94 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a14 <vector201>:
.globl vector201
vector201:
  pushl $0
c0102a14:	6a 00                	push   $0x0
  pushl $201
c0102a16:	68 c9 00 00 00       	push   $0xc9
  jmp __alltraps
c0102a1b:	e9 88 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a20 <vector202>:
.globl vector202
vector202:
  pushl $0
c0102a20:	6a 00                	push   $0x0
  pushl $202
c0102a22:	68 ca 00 00 00       	push   $0xca
  jmp __alltraps
c0102a27:	e9 7c 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a2c <vector203>:
.globl vector203
vector203:
  pushl $0
c0102a2c:	6a 00                	push   $0x0
  pushl $203
c0102a2e:	68 cb 00 00 00       	push   $0xcb
  jmp __alltraps
c0102a33:	e9 70 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a38 <vector204>:
.globl vector204
vector204:
  pushl $0
c0102a38:	6a 00                	push   $0x0
  pushl $204
c0102a3a:	68 cc 00 00 00       	push   $0xcc
  jmp __alltraps
c0102a3f:	e9 64 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a44 <vector205>:
.globl vector205
vector205:
  pushl $0
c0102a44:	6a 00                	push   $0x0
  pushl $205
c0102a46:	68 cd 00 00 00       	push   $0xcd
  jmp __alltraps
c0102a4b:	e9 58 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a50 <vector206>:
.globl vector206
vector206:
  pushl $0
c0102a50:	6a 00                	push   $0x0
  pushl $206
c0102a52:	68 ce 00 00 00       	push   $0xce
  jmp __alltraps
c0102a57:	e9 4c 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a5c <vector207>:
.globl vector207
vector207:
  pushl $0
c0102a5c:	6a 00                	push   $0x0
  pushl $207
c0102a5e:	68 cf 00 00 00       	push   $0xcf
  jmp __alltraps
c0102a63:	e9 40 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a68 <vector208>:
.globl vector208
vector208:
  pushl $0
c0102a68:	6a 00                	push   $0x0
  pushl $208
c0102a6a:	68 d0 00 00 00       	push   $0xd0
  jmp __alltraps
c0102a6f:	e9 34 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a74 <vector209>:
.globl vector209
vector209:
  pushl $0
c0102a74:	6a 00                	push   $0x0
  pushl $209
c0102a76:	68 d1 00 00 00       	push   $0xd1
  jmp __alltraps
c0102a7b:	e9 28 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a80 <vector210>:
.globl vector210
vector210:
  pushl $0
c0102a80:	6a 00                	push   $0x0
  pushl $210
c0102a82:	68 d2 00 00 00       	push   $0xd2
  jmp __alltraps
c0102a87:	e9 1c 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a8c <vector211>:
.globl vector211
vector211:
  pushl $0
c0102a8c:	6a 00                	push   $0x0
  pushl $211
c0102a8e:	68 d3 00 00 00       	push   $0xd3
  jmp __alltraps
c0102a93:	e9 10 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102a98 <vector212>:
.globl vector212
vector212:
  pushl $0
c0102a98:	6a 00                	push   $0x0
  pushl $212
c0102a9a:	68 d4 00 00 00       	push   $0xd4
  jmp __alltraps
c0102a9f:	e9 04 02 00 00       	jmp    c0102ca8 <__alltraps>

c0102aa4 <vector213>:
.globl vector213
vector213:
  pushl $0
c0102aa4:	6a 00                	push   $0x0
  pushl $213
c0102aa6:	68 d5 00 00 00       	push   $0xd5
  jmp __alltraps
c0102aab:	e9 f8 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102ab0 <vector214>:
.globl vector214
vector214:
  pushl $0
c0102ab0:	6a 00                	push   $0x0
  pushl $214
c0102ab2:	68 d6 00 00 00       	push   $0xd6
  jmp __alltraps
c0102ab7:	e9 ec 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102abc <vector215>:
.globl vector215
vector215:
  pushl $0
c0102abc:	6a 00                	push   $0x0
  pushl $215
c0102abe:	68 d7 00 00 00       	push   $0xd7
  jmp __alltraps
c0102ac3:	e9 e0 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102ac8 <vector216>:
.globl vector216
vector216:
  pushl $0
c0102ac8:	6a 00                	push   $0x0
  pushl $216
c0102aca:	68 d8 00 00 00       	push   $0xd8
  jmp __alltraps
c0102acf:	e9 d4 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102ad4 <vector217>:
.globl vector217
vector217:
  pushl $0
c0102ad4:	6a 00                	push   $0x0
  pushl $217
c0102ad6:	68 d9 00 00 00       	push   $0xd9
  jmp __alltraps
c0102adb:	e9 c8 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102ae0 <vector218>:
.globl vector218
vector218:
  pushl $0
c0102ae0:	6a 00                	push   $0x0
  pushl $218
c0102ae2:	68 da 00 00 00       	push   $0xda
  jmp __alltraps
c0102ae7:	e9 bc 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102aec <vector219>:
.globl vector219
vector219:
  pushl $0
c0102aec:	6a 00                	push   $0x0
  pushl $219
c0102aee:	68 db 00 00 00       	push   $0xdb
  jmp __alltraps
c0102af3:	e9 b0 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102af8 <vector220>:
.globl vector220
vector220:
  pushl $0
c0102af8:	6a 00                	push   $0x0
  pushl $220
c0102afa:	68 dc 00 00 00       	push   $0xdc
  jmp __alltraps
c0102aff:	e9 a4 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b04 <vector221>:
.globl vector221
vector221:
  pushl $0
c0102b04:	6a 00                	push   $0x0
  pushl $221
c0102b06:	68 dd 00 00 00       	push   $0xdd
  jmp __alltraps
c0102b0b:	e9 98 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b10 <vector222>:
.globl vector222
vector222:
  pushl $0
c0102b10:	6a 00                	push   $0x0
  pushl $222
c0102b12:	68 de 00 00 00       	push   $0xde
  jmp __alltraps
c0102b17:	e9 8c 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b1c <vector223>:
.globl vector223
vector223:
  pushl $0
c0102b1c:	6a 00                	push   $0x0
  pushl $223
c0102b1e:	68 df 00 00 00       	push   $0xdf
  jmp __alltraps
c0102b23:	e9 80 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b28 <vector224>:
.globl vector224
vector224:
  pushl $0
c0102b28:	6a 00                	push   $0x0
  pushl $224
c0102b2a:	68 e0 00 00 00       	push   $0xe0
  jmp __alltraps
c0102b2f:	e9 74 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b34 <vector225>:
.globl vector225
vector225:
  pushl $0
c0102b34:	6a 00                	push   $0x0
  pushl $225
c0102b36:	68 e1 00 00 00       	push   $0xe1
  jmp __alltraps
c0102b3b:	e9 68 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b40 <vector226>:
.globl vector226
vector226:
  pushl $0
c0102b40:	6a 00                	push   $0x0
  pushl $226
c0102b42:	68 e2 00 00 00       	push   $0xe2
  jmp __alltraps
c0102b47:	e9 5c 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b4c <vector227>:
.globl vector227
vector227:
  pushl $0
c0102b4c:	6a 00                	push   $0x0
  pushl $227
c0102b4e:	68 e3 00 00 00       	push   $0xe3
  jmp __alltraps
c0102b53:	e9 50 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b58 <vector228>:
.globl vector228
vector228:
  pushl $0
c0102b58:	6a 00                	push   $0x0
  pushl $228
c0102b5a:	68 e4 00 00 00       	push   $0xe4
  jmp __alltraps
c0102b5f:	e9 44 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b64 <vector229>:
.globl vector229
vector229:
  pushl $0
c0102b64:	6a 00                	push   $0x0
  pushl $229
c0102b66:	68 e5 00 00 00       	push   $0xe5
  jmp __alltraps
c0102b6b:	e9 38 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b70 <vector230>:
.globl vector230
vector230:
  pushl $0
c0102b70:	6a 00                	push   $0x0
  pushl $230
c0102b72:	68 e6 00 00 00       	push   $0xe6
  jmp __alltraps
c0102b77:	e9 2c 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b7c <vector231>:
.globl vector231
vector231:
  pushl $0
c0102b7c:	6a 00                	push   $0x0
  pushl $231
c0102b7e:	68 e7 00 00 00       	push   $0xe7
  jmp __alltraps
c0102b83:	e9 20 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b88 <vector232>:
.globl vector232
vector232:
  pushl $0
c0102b88:	6a 00                	push   $0x0
  pushl $232
c0102b8a:	68 e8 00 00 00       	push   $0xe8
  jmp __alltraps
c0102b8f:	e9 14 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102b94 <vector233>:
.globl vector233
vector233:
  pushl $0
c0102b94:	6a 00                	push   $0x0
  pushl $233
c0102b96:	68 e9 00 00 00       	push   $0xe9
  jmp __alltraps
c0102b9b:	e9 08 01 00 00       	jmp    c0102ca8 <__alltraps>

c0102ba0 <vector234>:
.globl vector234
vector234:
  pushl $0
c0102ba0:	6a 00                	push   $0x0
  pushl $234
c0102ba2:	68 ea 00 00 00       	push   $0xea
  jmp __alltraps
c0102ba7:	e9 fc 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102bac <vector235>:
.globl vector235
vector235:
  pushl $0
c0102bac:	6a 00                	push   $0x0
  pushl $235
c0102bae:	68 eb 00 00 00       	push   $0xeb
  jmp __alltraps
c0102bb3:	e9 f0 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102bb8 <vector236>:
.globl vector236
vector236:
  pushl $0
c0102bb8:	6a 00                	push   $0x0
  pushl $236
c0102bba:	68 ec 00 00 00       	push   $0xec
  jmp __alltraps
c0102bbf:	e9 e4 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102bc4 <vector237>:
.globl vector237
vector237:
  pushl $0
c0102bc4:	6a 00                	push   $0x0
  pushl $237
c0102bc6:	68 ed 00 00 00       	push   $0xed
  jmp __alltraps
c0102bcb:	e9 d8 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102bd0 <vector238>:
.globl vector238
vector238:
  pushl $0
c0102bd0:	6a 00                	push   $0x0
  pushl $238
c0102bd2:	68 ee 00 00 00       	push   $0xee
  jmp __alltraps
c0102bd7:	e9 cc 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102bdc <vector239>:
.globl vector239
vector239:
  pushl $0
c0102bdc:	6a 00                	push   $0x0
  pushl $239
c0102bde:	68 ef 00 00 00       	push   $0xef
  jmp __alltraps
c0102be3:	e9 c0 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102be8 <vector240>:
.globl vector240
vector240:
  pushl $0
c0102be8:	6a 00                	push   $0x0
  pushl $240
c0102bea:	68 f0 00 00 00       	push   $0xf0
  jmp __alltraps
c0102bef:	e9 b4 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102bf4 <vector241>:
.globl vector241
vector241:
  pushl $0
c0102bf4:	6a 00                	push   $0x0
  pushl $241
c0102bf6:	68 f1 00 00 00       	push   $0xf1
  jmp __alltraps
c0102bfb:	e9 a8 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c00 <vector242>:
.globl vector242
vector242:
  pushl $0
c0102c00:	6a 00                	push   $0x0
  pushl $242
c0102c02:	68 f2 00 00 00       	push   $0xf2
  jmp __alltraps
c0102c07:	e9 9c 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c0c <vector243>:
.globl vector243
vector243:
  pushl $0
c0102c0c:	6a 00                	push   $0x0
  pushl $243
c0102c0e:	68 f3 00 00 00       	push   $0xf3
  jmp __alltraps
c0102c13:	e9 90 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c18 <vector244>:
.globl vector244
vector244:
  pushl $0
c0102c18:	6a 00                	push   $0x0
  pushl $244
c0102c1a:	68 f4 00 00 00       	push   $0xf4
  jmp __alltraps
c0102c1f:	e9 84 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c24 <vector245>:
.globl vector245
vector245:
  pushl $0
c0102c24:	6a 00                	push   $0x0
  pushl $245
c0102c26:	68 f5 00 00 00       	push   $0xf5
  jmp __alltraps
c0102c2b:	e9 78 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c30 <vector246>:
.globl vector246
vector246:
  pushl $0
c0102c30:	6a 00                	push   $0x0
  pushl $246
c0102c32:	68 f6 00 00 00       	push   $0xf6
  jmp __alltraps
c0102c37:	e9 6c 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c3c <vector247>:
.globl vector247
vector247:
  pushl $0
c0102c3c:	6a 00                	push   $0x0
  pushl $247
c0102c3e:	68 f7 00 00 00       	push   $0xf7
  jmp __alltraps
c0102c43:	e9 60 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c48 <vector248>:
.globl vector248
vector248:
  pushl $0
c0102c48:	6a 00                	push   $0x0
  pushl $248
c0102c4a:	68 f8 00 00 00       	push   $0xf8
  jmp __alltraps
c0102c4f:	e9 54 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c54 <vector249>:
.globl vector249
vector249:
  pushl $0
c0102c54:	6a 00                	push   $0x0
  pushl $249
c0102c56:	68 f9 00 00 00       	push   $0xf9
  jmp __alltraps
c0102c5b:	e9 48 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c60 <vector250>:
.globl vector250
vector250:
  pushl $0
c0102c60:	6a 00                	push   $0x0
  pushl $250
c0102c62:	68 fa 00 00 00       	push   $0xfa
  jmp __alltraps
c0102c67:	e9 3c 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c6c <vector251>:
.globl vector251
vector251:
  pushl $0
c0102c6c:	6a 00                	push   $0x0
  pushl $251
c0102c6e:	68 fb 00 00 00       	push   $0xfb
  jmp __alltraps
c0102c73:	e9 30 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c78 <vector252>:
.globl vector252
vector252:
  pushl $0
c0102c78:	6a 00                	push   $0x0
  pushl $252
c0102c7a:	68 fc 00 00 00       	push   $0xfc
  jmp __alltraps
c0102c7f:	e9 24 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c84 <vector253>:
.globl vector253
vector253:
  pushl $0
c0102c84:	6a 00                	push   $0x0
  pushl $253
c0102c86:	68 fd 00 00 00       	push   $0xfd
  jmp __alltraps
c0102c8b:	e9 18 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c90 <vector254>:
.globl vector254
vector254:
  pushl $0
c0102c90:	6a 00                	push   $0x0
  pushl $254
c0102c92:	68 fe 00 00 00       	push   $0xfe
  jmp __alltraps
c0102c97:	e9 0c 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102c9c <vector255>:
.globl vector255
vector255:
  pushl $0
c0102c9c:	6a 00                	push   $0x0
  pushl $255
c0102c9e:	68 ff 00 00 00       	push   $0xff
  jmp __alltraps
c0102ca3:	e9 00 00 00 00       	jmp    c0102ca8 <__alltraps>

c0102ca8 <__alltraps>:
.text
.globl __alltraps
__alltraps:
    # push registers to build a trap frame
    # therefore make the stack look like a struct trapframe
    pushl %ds
c0102ca8:	1e                   	push   %ds
    pushl %es
c0102ca9:	06                   	push   %es
    pushl %fs
c0102caa:	0f a0                	push   %fs
    pushl %gs
c0102cac:	0f a8                	push   %gs
    pushal
c0102cae:	60                   	pusha  

    # load GD_KDATA into %ds and %es to set up data segments for kernel
    movl $GD_KDATA, %eax
c0102caf:	b8 10 00 00 00       	mov    $0x10,%eax
    movw %ax, %ds
c0102cb4:	8e d8                	mov    %eax,%ds
    movw %ax, %es
c0102cb6:	8e c0                	mov    %eax,%es

    # push %esp to pass a pointer to the trapframe as an argument to trap()
    pushl %esp
c0102cb8:	54                   	push   %esp

    # call trap(tf), where tf=%esp
    call trap
c0102cb9:	e8 60 f5 ff ff       	call   c010221e <trap>

    # pop the pushed stack pointer
    popl %esp
c0102cbe:	5c                   	pop    %esp

c0102cbf <__trapret>:

    # return falls through to trapret...
.globl __trapret
__trapret:
    # restore registers from stack
    popal
c0102cbf:	61                   	popa   

    # restore %ds, %es, %fs and %gs
    popl %gs
c0102cc0:	0f a9                	pop    %gs
    popl %fs
c0102cc2:	0f a1                	pop    %fs
    popl %es
c0102cc4:	07                   	pop    %es
    popl %ds
c0102cc5:	1f                   	pop    %ds

    # get rid of the trap number and error code
    addl $0x8, %esp
c0102cc6:	83 c4 08             	add    $0x8,%esp
    iret
c0102cc9:	cf                   	iret   

c0102cca <page_ref>:
pde2page(pde_t pde) {
    return pa2page(PDE_ADDR(pde));
}

static inline int
page_ref(struct Page *page) {
c0102cca:	55                   	push   %ebp
c0102ccb:	89 e5                	mov    %esp,%ebp
    return page->ref;
c0102ccd:	8b 45 08             	mov    0x8(%ebp),%eax
c0102cd0:	8b 00                	mov    (%eax),%eax
}
c0102cd2:	5d                   	pop    %ebp
c0102cd3:	c3                   	ret    

c0102cd4 <set_page_ref>:

static inline void
set_page_ref(struct Page *page, int val) {
c0102cd4:	55                   	push   %ebp
c0102cd5:	89 e5                	mov    %esp,%ebp
    page->ref = val;
c0102cd7:	8b 45 08             	mov    0x8(%ebp),%eax
c0102cda:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102cdd:	89 10                	mov    %edx,(%eax)
}
c0102cdf:	90                   	nop
c0102ce0:	5d                   	pop    %ebp
c0102ce1:	c3                   	ret    

c0102ce2 <fixsize>:
#define UINT32_MASK(a)          (UINT32_SHR_OR(UINT32_SHR_OR(UINT32_SHR_OR(UINT32_SHR_OR(UINT32_SHR_OR(a,1),2),4),8),16))    
//大于a的一个最小的2^k
#define UINT32_REMAINDER(a)     ((a)&(UINT32_MASK(a)>>1))
#define UINT32_ROUND_DOWN(a)    (UINT32_REMAINDER(a)?((a)-UINT32_REMAINDER(a)):(a))//小于a的最大的2^k

static unsigned fixsize(unsigned size) {
c0102ce2:	f3 0f 1e fb          	endbr32 
c0102ce6:	55                   	push   %ebp
c0102ce7:	89 e5                	mov    %esp,%ebp
  size |= size >> 1;
c0102ce9:	8b 45 08             	mov    0x8(%ebp),%eax
c0102cec:	d1 e8                	shr    %eax
c0102cee:	09 45 08             	or     %eax,0x8(%ebp)
  size |= size >> 2;
c0102cf1:	8b 45 08             	mov    0x8(%ebp),%eax
c0102cf4:	c1 e8 02             	shr    $0x2,%eax
c0102cf7:	09 45 08             	or     %eax,0x8(%ebp)
  size |= size >> 4;
c0102cfa:	8b 45 08             	mov    0x8(%ebp),%eax
c0102cfd:	c1 e8 04             	shr    $0x4,%eax
c0102d00:	09 45 08             	or     %eax,0x8(%ebp)
  size |= size >> 8;
c0102d03:	8b 45 08             	mov    0x8(%ebp),%eax
c0102d06:	c1 e8 08             	shr    $0x8,%eax
c0102d09:	09 45 08             	or     %eax,0x8(%ebp)
  size |= size >> 16;
c0102d0c:	8b 45 08             	mov    0x8(%ebp),%eax
c0102d0f:	c1 e8 10             	shr    $0x10,%eax
c0102d12:	09 45 08             	or     %eax,0x8(%ebp)
  return size+1;
c0102d15:	8b 45 08             	mov    0x8(%ebp),%eax
c0102d18:	40                   	inc    %eax
}
c0102d19:	5d                   	pop    %ebp
c0102d1a:	c3                   	ret    

c0102d1b <buddy_init>:

struct allocRecord rec[80000];//存放偏移量的数组
int nr_block;//已分配的块数

static void buddy_init()
{
c0102d1b:	f3 0f 1e fb          	endbr32 
c0102d1f:	55                   	push   %ebp
c0102d20:	89 e5                	mov    %esp,%ebp
c0102d22:	83 ec 10             	sub    $0x10,%esp
c0102d25:	c7 45 fc e0 33 1c c0 	movl   $0xc01c33e0,-0x4(%ebp)
 * list_init - initialize a new entry
 * @elm:        new entry to be initialized
 * */
static inline void
list_init(list_entry_t *elm) {
    elm->prev = elm->next = elm;
c0102d2c:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102d2f:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0102d32:	89 50 04             	mov    %edx,0x4(%eax)
c0102d35:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102d38:	8b 50 04             	mov    0x4(%eax),%edx
c0102d3b:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102d3e:	89 10                	mov    %edx,(%eax)
}
c0102d40:	90                   	nop
    list_init(&free_list);
    nr_free=0;
c0102d41:	c7 05 e8 33 1c c0 00 	movl   $0x0,0xc01c33e8
c0102d48:	00 00 00 
}
c0102d4b:	90                   	nop
c0102d4c:	c9                   	leave  
c0102d4d:	c3                   	ret    

c0102d4e <buddy2_new>:

//初始化二叉树上的节点
void buddy2_new( int size ) {
c0102d4e:	f3 0f 1e fb          	endbr32 
c0102d52:	55                   	push   %ebp
c0102d53:	89 e5                	mov    %esp,%ebp
c0102d55:	83 ec 10             	sub    $0x10,%esp
  unsigned node_size;
  int i;
  nr_block=0;
c0102d58:	c7 05 c0 6f 12 c0 00 	movl   $0x0,0xc0126fc0
c0102d5f:	00 00 00 
  if (size < 1 || !IS_POWER_OF_2(size))
c0102d62:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0102d66:	7e 54                	jle    c0102dbc <buddy2_new+0x6e>
c0102d68:	8b 45 08             	mov    0x8(%ebp),%eax
c0102d6b:	48                   	dec    %eax
c0102d6c:	23 45 08             	and    0x8(%ebp),%eax
c0102d6f:	85 c0                	test   %eax,%eax
c0102d71:	75 49                	jne    c0102dbc <buddy2_new+0x6e>
    return;

  root[0].size = size;
c0102d73:	8b 45 08             	mov    0x8(%ebp),%eax
c0102d76:	a3 e0 6f 12 c0       	mov    %eax,0xc0126fe0
  node_size = size * 2;
c0102d7b:	8b 45 08             	mov    0x8(%ebp),%eax
c0102d7e:	01 c0                	add    %eax,%eax
c0102d80:	89 45 fc             	mov    %eax,-0x4(%ebp)

  for (i = 0; i < 2 * size - 1; ++i) {
c0102d83:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
c0102d8a:	eb 23                	jmp    c0102daf <buddy2_new+0x61>
    if (IS_POWER_OF_2(i+1))
c0102d8c:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0102d8f:	40                   	inc    %eax
c0102d90:	23 45 f8             	and    -0x8(%ebp),%eax
c0102d93:	85 c0                	test   %eax,%eax
c0102d95:	75 08                	jne    c0102d9f <buddy2_new+0x51>
      node_size /= 2;
c0102d97:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0102d9a:	d1 e8                	shr    %eax
c0102d9c:	89 45 fc             	mov    %eax,-0x4(%ebp)
    root[i].longest = node_size;
c0102d9f:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0102da2:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0102da5:	89 14 c5 e4 6f 12 c0 	mov    %edx,-0x3fed901c(,%eax,8)
  for (i = 0; i < 2 * size - 1; ++i) {
c0102dac:	ff 45 f8             	incl   -0x8(%ebp)
c0102daf:	8b 45 08             	mov    0x8(%ebp),%eax
c0102db2:	01 c0                	add    %eax,%eax
c0102db4:	48                   	dec    %eax
c0102db5:	39 45 f8             	cmp    %eax,-0x8(%ebp)
c0102db8:	7c d2                	jl     c0102d8c <buddy2_new+0x3e>
  }
  return;
c0102dba:	eb 01                	jmp    c0102dbd <buddy2_new+0x6f>
    return;
c0102dbc:	90                   	nop
}
c0102dbd:	c9                   	leave  
c0102dbe:	c3                   	ret    

c0102dbf <buddy_init_memmap>:

//初始化内存映射关系
static void
buddy_init_memmap(struct Page *base, size_t n)
{
c0102dbf:	f3 0f 1e fb          	endbr32 
c0102dc3:	55                   	push   %ebp
c0102dc4:	89 e5                	mov    %esp,%ebp
c0102dc6:	56                   	push   %esi
c0102dc7:	53                   	push   %ebx
c0102dc8:	83 ec 40             	sub    $0x40,%esp
    assert(n>0);
c0102dcb:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0102dcf:	75 24                	jne    c0102df5 <buddy_init_memmap+0x36>
c0102dd1:	c7 44 24 0c 50 9c 10 	movl   $0xc0109c50,0xc(%esp)
c0102dd8:	c0 
c0102dd9:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c0102de0:	c0 
c0102de1:	c7 44 24 04 4f 00 00 	movl   $0x4f,0x4(%esp)
c0102de8:	00 
c0102de9:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c0102df0:	e8 2c d6 ff ff       	call   c0100421 <__panic>
    struct Page* p=base;
c0102df5:	8b 45 08             	mov    0x8(%ebp),%eax
c0102df8:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for(;p!=base + n;p++)
c0102dfb:	e9 df 00 00 00       	jmp    c0102edf <buddy_init_memmap+0x120>
    {
        assert(PageReserved(p));
c0102e00:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e03:	83 c0 04             	add    $0x4,%eax
c0102e06:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0102e0d:	89 45 e8             	mov    %eax,-0x18(%ebp)
 * @addr:   the address to count from
 * */
static inline bool
test_bit(int nr, volatile void *addr) {
    int oldbit;
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0102e10:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0102e13:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0102e16:	0f a3 10             	bt     %edx,(%eax)
c0102e19:	19 c0                	sbb    %eax,%eax
c0102e1b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return oldbit != 0;
c0102e1e:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0102e22:	0f 95 c0             	setne  %al
c0102e25:	0f b6 c0             	movzbl %al,%eax
c0102e28:	85 c0                	test   %eax,%eax
c0102e2a:	75 24                	jne    c0102e50 <buddy_init_memmap+0x91>
c0102e2c:	c7 44 24 0c 7d 9c 10 	movl   $0xc0109c7d,0xc(%esp)
c0102e33:	c0 
c0102e34:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c0102e3b:	c0 
c0102e3c:	c7 44 24 04 53 00 00 	movl   $0x53,0x4(%esp)
c0102e43:	00 
c0102e44:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c0102e4b:	e8 d1 d5 ff ff       	call   c0100421 <__panic>
        p->flags = 0;
c0102e50:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e53:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        p->property = 1;
c0102e5a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e5d:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
        set_page_ref(p, 0);   
c0102e64:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0102e6b:	00 
c0102e6c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e6f:	89 04 24             	mov    %eax,(%esp)
c0102e72:	e8 5d fe ff ff       	call   c0102cd4 <set_page_ref>
        SetPageProperty(p);
c0102e77:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e7a:	83 c0 04             	add    $0x4,%eax
c0102e7d:	c7 45 cc 01 00 00 00 	movl   $0x1,-0x34(%ebp)
c0102e84:	89 45 c8             	mov    %eax,-0x38(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0102e87:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0102e8a:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0102e8d:	0f ab 10             	bts    %edx,(%eax)
}
c0102e90:	90                   	nop
        list_add_before(&free_list,&(p->page_link));     
c0102e91:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0102e94:	83 c0 0c             	add    $0xc,%eax
c0102e97:	c7 45 e0 e0 33 1c c0 	movl   $0xc01c33e0,-0x20(%ebp)
c0102e9e:	89 45 dc             	mov    %eax,-0x24(%ebp)
 * Insert the new element @elm *before* the element @listelm which
 * is already in the list.
 * */
static inline void
list_add_before(list_entry_t *listelm, list_entry_t *elm) {
    __list_add(elm, listelm->prev, listelm);
c0102ea1:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0102ea4:	8b 00                	mov    (%eax),%eax
c0102ea6:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0102ea9:	89 55 d8             	mov    %edx,-0x28(%ebp)
c0102eac:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c0102eaf:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0102eb2:	89 45 d0             	mov    %eax,-0x30(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_add(list_entry_t *elm, list_entry_t *prev, list_entry_t *next) {
    prev->next = next->prev = elm;
c0102eb5:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0102eb8:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0102ebb:	89 10                	mov    %edx,(%eax)
c0102ebd:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0102ec0:	8b 10                	mov    (%eax),%edx
c0102ec2:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0102ec5:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0102ec8:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0102ecb:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0102ece:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0102ed1:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0102ed4:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0102ed7:	89 10                	mov    %edx,(%eax)
}
c0102ed9:	90                   	nop
}
c0102eda:	90                   	nop
    for(;p!=base + n;p++)
c0102edb:	83 45 f4 24          	addl   $0x24,-0xc(%ebp)
c0102edf:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102ee2:	89 d0                	mov    %edx,%eax
c0102ee4:	c1 e0 03             	shl    $0x3,%eax
c0102ee7:	01 d0                	add    %edx,%eax
c0102ee9:	c1 e0 02             	shl    $0x2,%eax
c0102eec:	89 c2                	mov    %eax,%edx
c0102eee:	8b 45 08             	mov    0x8(%ebp),%eax
c0102ef1:	01 d0                	add    %edx,%eax
c0102ef3:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0102ef6:	0f 85 04 ff ff ff    	jne    c0102e00 <buddy_init_memmap+0x41>
    }
    nr_free += n;
c0102efc:	8b 15 e8 33 1c c0    	mov    0xc01c33e8,%edx
c0102f02:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102f05:	01 d0                	add    %edx,%eax
c0102f07:	a3 e8 33 1c c0       	mov    %eax,0xc01c33e8
    int allocpages=UINT32_ROUND_DOWN(n);
c0102f0c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102f0f:	d1 e8                	shr    %eax
c0102f11:	0b 45 0c             	or     0xc(%ebp),%eax
c0102f14:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102f17:	d1 ea                	shr    %edx
c0102f19:	0b 55 0c             	or     0xc(%ebp),%edx
c0102f1c:	c1 ea 02             	shr    $0x2,%edx
c0102f1f:	09 d0                	or     %edx,%eax
c0102f21:	89 c1                	mov    %eax,%ecx
c0102f23:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102f26:	d1 e8                	shr    %eax
c0102f28:	0b 45 0c             	or     0xc(%ebp),%eax
c0102f2b:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102f2e:	d1 ea                	shr    %edx
c0102f30:	0b 55 0c             	or     0xc(%ebp),%edx
c0102f33:	c1 ea 02             	shr    $0x2,%edx
c0102f36:	09 d0                	or     %edx,%eax
c0102f38:	c1 e8 04             	shr    $0x4,%eax
c0102f3b:	09 c1                	or     %eax,%ecx
c0102f3d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102f40:	d1 e8                	shr    %eax
c0102f42:	0b 45 0c             	or     0xc(%ebp),%eax
c0102f45:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102f48:	d1 ea                	shr    %edx
c0102f4a:	0b 55 0c             	or     0xc(%ebp),%edx
c0102f4d:	c1 ea 02             	shr    $0x2,%edx
c0102f50:	09 d0                	or     %edx,%eax
c0102f52:	89 c3                	mov    %eax,%ebx
c0102f54:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102f57:	d1 e8                	shr    %eax
c0102f59:	0b 45 0c             	or     0xc(%ebp),%eax
c0102f5c:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102f5f:	d1 ea                	shr    %edx
c0102f61:	0b 55 0c             	or     0xc(%ebp),%edx
c0102f64:	c1 ea 02             	shr    $0x2,%edx
c0102f67:	09 d0                	or     %edx,%eax
c0102f69:	c1 e8 04             	shr    $0x4,%eax
c0102f6c:	09 d8                	or     %ebx,%eax
c0102f6e:	c1 e8 08             	shr    $0x8,%eax
c0102f71:	09 c1                	or     %eax,%ecx
c0102f73:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102f76:	d1 e8                	shr    %eax
c0102f78:	0b 45 0c             	or     0xc(%ebp),%eax
c0102f7b:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102f7e:	d1 ea                	shr    %edx
c0102f80:	0b 55 0c             	or     0xc(%ebp),%edx
c0102f83:	c1 ea 02             	shr    $0x2,%edx
c0102f86:	09 d0                	or     %edx,%eax
c0102f88:	89 c3                	mov    %eax,%ebx
c0102f8a:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102f8d:	d1 e8                	shr    %eax
c0102f8f:	0b 45 0c             	or     0xc(%ebp),%eax
c0102f92:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102f95:	d1 ea                	shr    %edx
c0102f97:	0b 55 0c             	or     0xc(%ebp),%edx
c0102f9a:	c1 ea 02             	shr    $0x2,%edx
c0102f9d:	09 d0                	or     %edx,%eax
c0102f9f:	c1 e8 04             	shr    $0x4,%eax
c0102fa2:	09 c3                	or     %eax,%ebx
c0102fa4:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102fa7:	d1 e8                	shr    %eax
c0102fa9:	0b 45 0c             	or     0xc(%ebp),%eax
c0102fac:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102faf:	d1 ea                	shr    %edx
c0102fb1:	0b 55 0c             	or     0xc(%ebp),%edx
c0102fb4:	c1 ea 02             	shr    $0x2,%edx
c0102fb7:	09 d0                	or     %edx,%eax
c0102fb9:	89 c6                	mov    %eax,%esi
c0102fbb:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102fbe:	d1 e8                	shr    %eax
c0102fc0:	0b 45 0c             	or     0xc(%ebp),%eax
c0102fc3:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102fc6:	d1 ea                	shr    %edx
c0102fc8:	0b 55 0c             	or     0xc(%ebp),%edx
c0102fcb:	c1 ea 02             	shr    $0x2,%edx
c0102fce:	09 d0                	or     %edx,%eax
c0102fd0:	c1 e8 04             	shr    $0x4,%eax
c0102fd3:	09 f0                	or     %esi,%eax
c0102fd5:	c1 e8 08             	shr    $0x8,%eax
c0102fd8:	09 d8                	or     %ebx,%eax
c0102fda:	c1 e8 10             	shr    $0x10,%eax
c0102fdd:	09 c8                	or     %ecx,%eax
c0102fdf:	d1 e8                	shr    %eax
c0102fe1:	23 45 0c             	and    0xc(%ebp),%eax
c0102fe4:	85 c0                	test   %eax,%eax
c0102fe6:	0f 84 dc 00 00 00    	je     c01030c8 <buddy_init_memmap+0x309>
c0102fec:	8b 45 0c             	mov    0xc(%ebp),%eax
c0102fef:	d1 e8                	shr    %eax
c0102ff1:	0b 45 0c             	or     0xc(%ebp),%eax
c0102ff4:	8b 55 0c             	mov    0xc(%ebp),%edx
c0102ff7:	d1 ea                	shr    %edx
c0102ff9:	0b 55 0c             	or     0xc(%ebp),%edx
c0102ffc:	c1 ea 02             	shr    $0x2,%edx
c0102fff:	09 d0                	or     %edx,%eax
c0103001:	89 c1                	mov    %eax,%ecx
c0103003:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103006:	d1 e8                	shr    %eax
c0103008:	0b 45 0c             	or     0xc(%ebp),%eax
c010300b:	8b 55 0c             	mov    0xc(%ebp),%edx
c010300e:	d1 ea                	shr    %edx
c0103010:	0b 55 0c             	or     0xc(%ebp),%edx
c0103013:	c1 ea 02             	shr    $0x2,%edx
c0103016:	09 d0                	or     %edx,%eax
c0103018:	c1 e8 04             	shr    $0x4,%eax
c010301b:	09 c1                	or     %eax,%ecx
c010301d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103020:	d1 e8                	shr    %eax
c0103022:	0b 45 0c             	or     0xc(%ebp),%eax
c0103025:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103028:	d1 ea                	shr    %edx
c010302a:	0b 55 0c             	or     0xc(%ebp),%edx
c010302d:	c1 ea 02             	shr    $0x2,%edx
c0103030:	09 d0                	or     %edx,%eax
c0103032:	89 c3                	mov    %eax,%ebx
c0103034:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103037:	d1 e8                	shr    %eax
c0103039:	0b 45 0c             	or     0xc(%ebp),%eax
c010303c:	8b 55 0c             	mov    0xc(%ebp),%edx
c010303f:	d1 ea                	shr    %edx
c0103041:	0b 55 0c             	or     0xc(%ebp),%edx
c0103044:	c1 ea 02             	shr    $0x2,%edx
c0103047:	09 d0                	or     %edx,%eax
c0103049:	c1 e8 04             	shr    $0x4,%eax
c010304c:	09 d8                	or     %ebx,%eax
c010304e:	c1 e8 08             	shr    $0x8,%eax
c0103051:	09 c1                	or     %eax,%ecx
c0103053:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103056:	d1 e8                	shr    %eax
c0103058:	0b 45 0c             	or     0xc(%ebp),%eax
c010305b:	8b 55 0c             	mov    0xc(%ebp),%edx
c010305e:	d1 ea                	shr    %edx
c0103060:	0b 55 0c             	or     0xc(%ebp),%edx
c0103063:	c1 ea 02             	shr    $0x2,%edx
c0103066:	09 d0                	or     %edx,%eax
c0103068:	89 c3                	mov    %eax,%ebx
c010306a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010306d:	d1 e8                	shr    %eax
c010306f:	0b 45 0c             	or     0xc(%ebp),%eax
c0103072:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103075:	d1 ea                	shr    %edx
c0103077:	0b 55 0c             	or     0xc(%ebp),%edx
c010307a:	c1 ea 02             	shr    $0x2,%edx
c010307d:	09 d0                	or     %edx,%eax
c010307f:	c1 e8 04             	shr    $0x4,%eax
c0103082:	09 c3                	or     %eax,%ebx
c0103084:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103087:	d1 e8                	shr    %eax
c0103089:	0b 45 0c             	or     0xc(%ebp),%eax
c010308c:	8b 55 0c             	mov    0xc(%ebp),%edx
c010308f:	d1 ea                	shr    %edx
c0103091:	0b 55 0c             	or     0xc(%ebp),%edx
c0103094:	c1 ea 02             	shr    $0x2,%edx
c0103097:	09 d0                	or     %edx,%eax
c0103099:	89 c6                	mov    %eax,%esi
c010309b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010309e:	d1 e8                	shr    %eax
c01030a0:	0b 45 0c             	or     0xc(%ebp),%eax
c01030a3:	8b 55 0c             	mov    0xc(%ebp),%edx
c01030a6:	d1 ea                	shr    %edx
c01030a8:	0b 55 0c             	or     0xc(%ebp),%edx
c01030ab:	c1 ea 02             	shr    $0x2,%edx
c01030ae:	09 d0                	or     %edx,%eax
c01030b0:	c1 e8 04             	shr    $0x4,%eax
c01030b3:	09 f0                	or     %esi,%eax
c01030b5:	c1 e8 08             	shr    $0x8,%eax
c01030b8:	09 d8                	or     %ebx,%eax
c01030ba:	c1 e8 10             	shr    $0x10,%eax
c01030bd:	09 c8                	or     %ecx,%eax
c01030bf:	d1 e8                	shr    %eax
c01030c1:	f7 d0                	not    %eax
c01030c3:	23 45 0c             	and    0xc(%ebp),%eax
c01030c6:	eb 03                	jmp    c01030cb <buddy_init_memmap+0x30c>
c01030c8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01030cb:	89 45 f0             	mov    %eax,-0x10(%ebp)
    buddy2_new(allocpages);
c01030ce:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01030d1:	89 04 24             	mov    %eax,(%esp)
c01030d4:	e8 75 fc ff ff       	call   c0102d4e <buddy2_new>
}
c01030d9:	90                   	nop
c01030da:	83 c4 40             	add    $0x40,%esp
c01030dd:	5b                   	pop    %ebx
c01030de:	5e                   	pop    %esi
c01030df:	5d                   	pop    %ebp
c01030e0:	c3                   	ret    

c01030e1 <buddy2_alloc>:
//内存分配
int buddy2_alloc(struct buddy2* self, int size) {
c01030e1:	f3 0f 1e fb          	endbr32 
c01030e5:	55                   	push   %ebp
c01030e6:	89 e5                	mov    %esp,%ebp
c01030e8:	53                   	push   %ebx
c01030e9:	83 ec 14             	sub    $0x14,%esp
  unsigned index = 0;//节点的标号
c01030ec:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
  unsigned node_size;
  unsigned offset = 0;
c01030f3:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)

  if (self==NULL)//无法分配
c01030fa:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c01030fe:	75 0a                	jne    c010310a <buddy2_alloc+0x29>
    return -1;
c0103100:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0103105:	e9 63 01 00 00       	jmp    c010326d <buddy2_alloc+0x18c>

  if (size <= 0)//分配不合理
c010310a:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c010310e:	7f 09                	jg     c0103119 <buddy2_alloc+0x38>
    size = 1;
c0103110:	c7 45 0c 01 00 00 00 	movl   $0x1,0xc(%ebp)
c0103117:	eb 19                	jmp    c0103132 <buddy2_alloc+0x51>
  else if (!IS_POWER_OF_2(size))//不为2的幂时，取比size更大的2的n次幂
c0103119:	8b 45 0c             	mov    0xc(%ebp),%eax
c010311c:	48                   	dec    %eax
c010311d:	23 45 0c             	and    0xc(%ebp),%eax
c0103120:	85 c0                	test   %eax,%eax
c0103122:	74 0e                	je     c0103132 <buddy2_alloc+0x51>
    size = fixsize(size);
c0103124:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103127:	89 04 24             	mov    %eax,(%esp)
c010312a:	e8 b3 fb ff ff       	call   c0102ce2 <fixsize>
c010312f:	89 45 0c             	mov    %eax,0xc(%ebp)

  if (self[index].longest < size)//可分配内存不足
c0103132:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0103135:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
c010313c:	8b 45 08             	mov    0x8(%ebp),%eax
c010313f:	01 d0                	add    %edx,%eax
c0103141:	8b 50 04             	mov    0x4(%eax),%edx
c0103144:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103147:	39 c2                	cmp    %eax,%edx
c0103149:	73 0a                	jae    c0103155 <buddy2_alloc+0x74>
    return -1;
c010314b:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
c0103150:	e9 18 01 00 00       	jmp    c010326d <buddy2_alloc+0x18c>

  for(node_size = self->size; node_size != size; node_size /= 2 ) {
c0103155:	8b 45 08             	mov    0x8(%ebp),%eax
c0103158:	8b 00                	mov    (%eax),%eax
c010315a:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010315d:	e9 85 00 00 00       	jmp    c01031e7 <buddy2_alloc+0x106>
    if (self[LEFT_LEAF(index)].longest >= size)
c0103162:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0103165:	c1 e0 04             	shl    $0x4,%eax
c0103168:	8d 50 08             	lea    0x8(%eax),%edx
c010316b:	8b 45 08             	mov    0x8(%ebp),%eax
c010316e:	01 d0                	add    %edx,%eax
c0103170:	8b 50 04             	mov    0x4(%eax),%edx
c0103173:	8b 45 0c             	mov    0xc(%ebp),%eax
c0103176:	39 c2                	cmp    %eax,%edx
c0103178:	72 5c                	jb     c01031d6 <buddy2_alloc+0xf5>
    {
       if(self[RIGHT_LEAF(index)].longest>=size)
c010317a:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010317d:	40                   	inc    %eax
c010317e:	c1 e0 04             	shl    $0x4,%eax
c0103181:	89 c2                	mov    %eax,%edx
c0103183:	8b 45 08             	mov    0x8(%ebp),%eax
c0103186:	01 d0                	add    %edx,%eax
c0103188:	8b 50 04             	mov    0x4(%eax),%edx
c010318b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010318e:	39 c2                	cmp    %eax,%edx
c0103190:	72 39                	jb     c01031cb <buddy2_alloc+0xea>
        {
           index=self[LEFT_LEAF(index)].longest <= self[RIGHT_LEAF(index)].longest? LEFT_LEAF(index):RIGHT_LEAF(index);
c0103192:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0103195:	c1 e0 04             	shl    $0x4,%eax
c0103198:	8d 50 08             	lea    0x8(%eax),%edx
c010319b:	8b 45 08             	mov    0x8(%ebp),%eax
c010319e:	01 d0                	add    %edx,%eax
c01031a0:	8b 50 04             	mov    0x4(%eax),%edx
c01031a3:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01031a6:	40                   	inc    %eax
c01031a7:	c1 e0 04             	shl    $0x4,%eax
c01031aa:	89 c1                	mov    %eax,%ecx
c01031ac:	8b 45 08             	mov    0x8(%ebp),%eax
c01031af:	01 c8                	add    %ecx,%eax
c01031b1:	8b 40 04             	mov    0x4(%eax),%eax
c01031b4:	39 c2                	cmp    %eax,%edx
c01031b6:	77 08                	ja     c01031c0 <buddy2_alloc+0xdf>
c01031b8:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01031bb:	01 c0                	add    %eax,%eax
c01031bd:	40                   	inc    %eax
c01031be:	eb 06                	jmp    c01031c6 <buddy2_alloc+0xe5>
c01031c0:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01031c3:	40                   	inc    %eax
c01031c4:	01 c0                	add    %eax,%eax
c01031c6:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01031c9:	eb 14                	jmp    c01031df <buddy2_alloc+0xfe>
         //找到两个相符合的节点中内存较小的结点
        }
       else
       {
         index=LEFT_LEAF(index);
c01031cb:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01031ce:	01 c0                	add    %eax,%eax
c01031d0:	40                   	inc    %eax
c01031d1:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01031d4:	eb 09                	jmp    c01031df <buddy2_alloc+0xfe>
       }  
    }
    else
      index = RIGHT_LEAF(index);
c01031d6:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01031d9:	40                   	inc    %eax
c01031da:	01 c0                	add    %eax,%eax
c01031dc:	89 45 f8             	mov    %eax,-0x8(%ebp)
  for(node_size = self->size; node_size != size; node_size /= 2 ) {
c01031df:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01031e2:	d1 e8                	shr    %eax
c01031e4:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01031e7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01031ea:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c01031ed:	0f 85 6f ff ff ff    	jne    c0103162 <buddy2_alloc+0x81>
  }

  self[index].longest = 0;//标记节点为已使用
c01031f3:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01031f6:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
c01031fd:	8b 45 08             	mov    0x8(%ebp),%eax
c0103200:	01 d0                	add    %edx,%eax
c0103202:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
  offset = (index + 1) * node_size - self->size;
c0103209:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010320c:	40                   	inc    %eax
c010320d:	0f af 45 f4          	imul   -0xc(%ebp),%eax
c0103211:	89 c2                	mov    %eax,%edx
c0103213:	8b 45 08             	mov    0x8(%ebp),%eax
c0103216:	8b 00                	mov    (%eax),%eax
c0103218:	29 c2                	sub    %eax,%edx
c010321a:	89 d0                	mov    %edx,%eax
c010321c:	89 45 f0             	mov    %eax,-0x10(%ebp)
  while (index) {
c010321f:	eb 43                	jmp    c0103264 <buddy2_alloc+0x183>
    index = PARENT(index);
c0103221:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0103224:	40                   	inc    %eax
c0103225:	d1 e8                	shr    %eax
c0103227:	48                   	dec    %eax
c0103228:	89 45 f8             	mov    %eax,-0x8(%ebp)
    self[index].longest = 
      MAX(self[LEFT_LEAF(index)].longest, self[RIGHT_LEAF(index)].longest);
c010322b:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010322e:	40                   	inc    %eax
c010322f:	c1 e0 04             	shl    $0x4,%eax
c0103232:	89 c2                	mov    %eax,%edx
c0103234:	8b 45 08             	mov    0x8(%ebp),%eax
c0103237:	01 d0                	add    %edx,%eax
c0103239:	8b 50 04             	mov    0x4(%eax),%edx
c010323c:	8b 45 f8             	mov    -0x8(%ebp),%eax
c010323f:	c1 e0 04             	shl    $0x4,%eax
c0103242:	8d 48 08             	lea    0x8(%eax),%ecx
c0103245:	8b 45 08             	mov    0x8(%ebp),%eax
c0103248:	01 c8                	add    %ecx,%eax
c010324a:	8b 40 04             	mov    0x4(%eax),%eax
    self[index].longest = 
c010324d:	8b 4d f8             	mov    -0x8(%ebp),%ecx
c0103250:	8d 1c cd 00 00 00 00 	lea    0x0(,%ecx,8),%ebx
c0103257:	8b 4d 08             	mov    0x8(%ebp),%ecx
c010325a:	01 d9                	add    %ebx,%ecx
      MAX(self[LEFT_LEAF(index)].longest, self[RIGHT_LEAF(index)].longest);
c010325c:	39 c2                	cmp    %eax,%edx
c010325e:	0f 43 c2             	cmovae %edx,%eax
    self[index].longest = 
c0103261:	89 41 04             	mov    %eax,0x4(%ecx)
  while (index) {
c0103264:	83 7d f8 00          	cmpl   $0x0,-0x8(%ebp)
c0103268:	75 b7                	jne    c0103221 <buddy2_alloc+0x140>
  }
//向上刷新，修改先祖结点的数值
  return offset;
c010326a:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c010326d:	83 c4 14             	add    $0x14,%esp
c0103270:	5b                   	pop    %ebx
c0103271:	5d                   	pop    %ebp
c0103272:	c3                   	ret    

c0103273 <buddy_alloc_pages>:

static struct Page*
buddy_alloc_pages(size_t n){
c0103273:	f3 0f 1e fb          	endbr32 
c0103277:	55                   	push   %ebp
c0103278:	89 e5                	mov    %esp,%ebp
c010327a:	53                   	push   %ebx
c010327b:	83 ec 44             	sub    $0x44,%esp
  assert(n>0);
c010327e:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0103282:	75 24                	jne    c01032a8 <buddy_alloc_pages+0x35>
c0103284:	c7 44 24 0c 50 9c 10 	movl   $0xc0109c50,0xc(%esp)
c010328b:	c0 
c010328c:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c0103293:	c0 
c0103294:	c7 44 24 04 8d 00 00 	movl   $0x8d,0x4(%esp)
c010329b:	00 
c010329c:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c01032a3:	e8 79 d1 ff ff       	call   c0100421 <__panic>
  if(n>nr_free)
c01032a8:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
c01032ad:	39 45 08             	cmp    %eax,0x8(%ebp)
c01032b0:	76 0a                	jbe    c01032bc <buddy_alloc_pages+0x49>
   return NULL;
c01032b2:	b8 00 00 00 00       	mov    $0x0,%eax
c01032b7:	e9 41 01 00 00       	jmp    c01033fd <buddy_alloc_pages+0x18a>
  struct Page* page=NULL;
c01032bc:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  struct Page* p;
  list_entry_t *le=&free_list,*len;
c01032c3:	c7 45 f4 e0 33 1c c0 	movl   $0xc01c33e0,-0xc(%ebp)
  rec[nr_block].offset=buddy2_alloc(root,n);//记录偏移量
c01032ca:	8b 45 08             	mov    0x8(%ebp),%eax
c01032cd:	8b 1d c0 6f 12 c0    	mov    0xc0126fc0,%ebx
c01032d3:	89 44 24 04          	mov    %eax,0x4(%esp)
c01032d7:	c7 04 24 e0 6f 12 c0 	movl   $0xc0126fe0,(%esp)
c01032de:	e8 fe fd ff ff       	call   c01030e1 <buddy2_alloc>
c01032e3:	89 c2                	mov    %eax,%edx
c01032e5:	89 d8                	mov    %ebx,%eax
c01032e7:	01 c0                	add    %eax,%eax
c01032e9:	01 d8                	add    %ebx,%eax
c01032eb:	c1 e0 02             	shl    $0x2,%eax
c01032ee:	05 04 34 1c c0       	add    $0xc01c3404,%eax
c01032f3:	89 10                	mov    %edx,(%eax)
  int i;
  for(i=0;i<rec[nr_block].offset+1;i++)
c01032f5:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c01032fc:	eb 12                	jmp    c0103310 <buddy_alloc_pages+0x9d>
c01032fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103301:	89 45 dc             	mov    %eax,-0x24(%ebp)
    return listelm->next;
c0103304:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0103307:	8b 40 04             	mov    0x4(%eax),%eax
    le=list_next(le);
c010330a:	89 45 f4             	mov    %eax,-0xc(%ebp)
  for(i=0;i<rec[nr_block].offset+1;i++)
c010330d:	ff 45 f0             	incl   -0x10(%ebp)
c0103310:	8b 15 c0 6f 12 c0    	mov    0xc0126fc0,%edx
c0103316:	89 d0                	mov    %edx,%eax
c0103318:	01 c0                	add    %eax,%eax
c010331a:	01 d0                	add    %edx,%eax
c010331c:	c1 e0 02             	shl    $0x2,%eax
c010331f:	05 04 34 1c c0       	add    $0xc01c3404,%eax
c0103324:	8b 00                	mov    (%eax),%eax
c0103326:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0103329:	7e d3                	jle    c01032fe <buddy_alloc_pages+0x8b>
  page=le2page(le,page_link);
c010332b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010332e:	83 e8 0c             	sub    $0xc,%eax
c0103331:	89 45 e8             	mov    %eax,-0x18(%ebp)
  int allocpages;
  if(!IS_POWER_OF_2(n))
c0103334:	8b 45 08             	mov    0x8(%ebp),%eax
c0103337:	48                   	dec    %eax
c0103338:	23 45 08             	and    0x8(%ebp),%eax
c010333b:	85 c0                	test   %eax,%eax
c010333d:	74 10                	je     c010334f <buddy_alloc_pages+0xdc>
   allocpages=fixsize(n);
c010333f:	8b 45 08             	mov    0x8(%ebp),%eax
c0103342:	89 04 24             	mov    %eax,(%esp)
c0103345:	e8 98 f9 ff ff       	call   c0102ce2 <fixsize>
c010334a:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010334d:	eb 06                	jmp    c0103355 <buddy_alloc_pages+0xe2>
  else
  {
     allocpages=n;
c010334f:	8b 45 08             	mov    0x8(%ebp),%eax
c0103352:	89 45 ec             	mov    %eax,-0x14(%ebp)
  }
  //根据需求n得到块大小
  rec[nr_block].base=page;//记录分配块首页
c0103355:	8b 15 c0 6f 12 c0    	mov    0xc0126fc0,%edx
c010335b:	89 d0                	mov    %edx,%eax
c010335d:	01 c0                	add    %eax,%eax
c010335f:	01 d0                	add    %edx,%eax
c0103361:	c1 e0 02             	shl    $0x2,%eax
c0103364:	8d 90 00 34 1c c0    	lea    -0x3fe3cc00(%eax),%edx
c010336a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010336d:	89 02                	mov    %eax,(%edx)
  rec[nr_block].nr=allocpages;//记录分配的页数
c010336f:	8b 15 c0 6f 12 c0    	mov    0xc0126fc0,%edx
c0103375:	8b 4d ec             	mov    -0x14(%ebp),%ecx
c0103378:	89 d0                	mov    %edx,%eax
c010337a:	01 c0                	add    %eax,%eax
c010337c:	01 d0                	add    %edx,%eax
c010337e:	c1 e0 02             	shl    $0x2,%eax
c0103381:	05 08 34 1c c0       	add    $0xc01c3408,%eax
c0103386:	89 08                	mov    %ecx,(%eax)
  nr_block++;
c0103388:	a1 c0 6f 12 c0       	mov    0xc0126fc0,%eax
c010338d:	40                   	inc    %eax
c010338e:	a3 c0 6f 12 c0       	mov    %eax,0xc0126fc0
  for(i=0;i<allocpages;i++)
c0103393:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c010339a:	eb 3b                	jmp    c01033d7 <buddy_alloc_pages+0x164>
c010339c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010339f:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01033a2:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01033a5:	8b 40 04             	mov    0x4(%eax),%eax
  {
    len=list_next(le);
c01033a8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    p=le2page(le,page_link);
c01033ab:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01033ae:	83 e8 0c             	sub    $0xc,%eax
c01033b1:	89 45 e0             	mov    %eax,-0x20(%ebp)
    ClearPageProperty(p);
c01033b4:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01033b7:	83 c0 04             	add    $0x4,%eax
c01033ba:	c7 45 d8 01 00 00 00 	movl   $0x1,-0x28(%ebp)
c01033c1:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c01033c4:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01033c7:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01033ca:	0f b3 10             	btr    %edx,(%eax)
}
c01033cd:	90                   	nop
    le=len;
c01033ce:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01033d1:	89 45 f4             	mov    %eax,-0xc(%ebp)
  for(i=0;i<allocpages;i++)
c01033d4:	ff 45 f0             	incl   -0x10(%ebp)
c01033d7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01033da:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c01033dd:	7c bd                	jl     c010339c <buddy_alloc_pages+0x129>
  }//修改每一页的状态
  nr_free-=allocpages;//减去已被分配的页数
c01033df:	8b 15 e8 33 1c c0    	mov    0xc01c33e8,%edx
c01033e5:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01033e8:	29 c2                	sub    %eax,%edx
c01033ea:	89 d0                	mov    %edx,%eax
c01033ec:	a3 e8 33 1c c0       	mov    %eax,0xc01c33e8
  page->property=n;
c01033f1:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01033f4:	8b 55 08             	mov    0x8(%ebp),%edx
c01033f7:	89 50 08             	mov    %edx,0x8(%eax)
  return page;
c01033fa:	8b 45 e8             	mov    -0x18(%ebp),%eax
}
c01033fd:	83 c4 44             	add    $0x44,%esp
c0103400:	5b                   	pop    %ebx
c0103401:	5d                   	pop    %ebp
c0103402:	c3                   	ret    

c0103403 <buddy_free_pages>:

void buddy_free_pages(struct Page* base, size_t n) {
c0103403:	f3 0f 1e fb          	endbr32 
c0103407:	55                   	push   %ebp
c0103408:	89 e5                	mov    %esp,%ebp
c010340a:	83 ec 58             	sub    $0x58,%esp
  unsigned node_size, index = 0;
c010340d:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  unsigned left_longest, right_longest;
  struct buddy2* self=root;
c0103414:	c7 45 e0 e0 6f 12 c0 	movl   $0xc0126fe0,-0x20(%ebp)
c010341b:	c7 45 c8 e0 33 1c c0 	movl   $0xc01c33e0,-0x38(%ebp)
c0103422:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0103425:	8b 40 04             	mov    0x4(%eax),%eax
  
  list_entry_t *le=list_next(&free_list);
c0103428:	89 45 ec             	mov    %eax,-0x14(%ebp)
  int i=0;
c010342b:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  for(i=0;i<nr_block;i++)//找到块
c0103432:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0103439:	eb 1b                	jmp    c0103456 <buddy_free_pages+0x53>
  {
    if(rec[i].base==base)
c010343b:	8b 55 e8             	mov    -0x18(%ebp),%edx
c010343e:	89 d0                	mov    %edx,%eax
c0103440:	01 c0                	add    %eax,%eax
c0103442:	01 d0                	add    %edx,%eax
c0103444:	c1 e0 02             	shl    $0x2,%eax
c0103447:	05 00 34 1c c0       	add    $0xc01c3400,%eax
c010344c:	8b 00                	mov    (%eax),%eax
c010344e:	39 45 08             	cmp    %eax,0x8(%ebp)
c0103451:	74 0f                	je     c0103462 <buddy_free_pages+0x5f>
  for(i=0;i<nr_block;i++)//找到块
c0103453:	ff 45 e8             	incl   -0x18(%ebp)
c0103456:	a1 c0 6f 12 c0       	mov    0xc0126fc0,%eax
c010345b:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c010345e:	7c db                	jl     c010343b <buddy_free_pages+0x38>
c0103460:	eb 01                	jmp    c0103463 <buddy_free_pages+0x60>
     break;
c0103462:	90                   	nop
  }
  int offset=rec[i].offset;
c0103463:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0103466:	89 d0                	mov    %edx,%eax
c0103468:	01 c0                	add    %eax,%eax
c010346a:	01 d0                	add    %edx,%eax
c010346c:	c1 e0 02             	shl    $0x2,%eax
c010346f:	05 04 34 1c c0       	add    $0xc01c3404,%eax
c0103474:	8b 00                	mov    (%eax),%eax
c0103476:	89 45 dc             	mov    %eax,-0x24(%ebp)
  int pos=i;//暂存i
c0103479:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010347c:	89 45 d8             	mov    %eax,-0x28(%ebp)
  i=0;
c010347f:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
  while(i<offset)
c0103486:	eb 12                	jmp    c010349a <buddy_free_pages+0x97>
c0103488:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010348b:	89 45 c4             	mov    %eax,-0x3c(%ebp)
c010348e:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0103491:	8b 40 04             	mov    0x4(%eax),%eax
  {
    le=list_next(le);
c0103494:	89 45 ec             	mov    %eax,-0x14(%ebp)
    i++;
c0103497:	ff 45 e8             	incl   -0x18(%ebp)
  while(i<offset)
c010349a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010349d:	3b 45 dc             	cmp    -0x24(%ebp),%eax
c01034a0:	7c e6                	jl     c0103488 <buddy_free_pages+0x85>
  }
  int allocpages;
  if(!IS_POWER_OF_2(n))
c01034a2:	8b 45 0c             	mov    0xc(%ebp),%eax
c01034a5:	48                   	dec    %eax
c01034a6:	23 45 0c             	and    0xc(%ebp),%eax
c01034a9:	85 c0                	test   %eax,%eax
c01034ab:	74 10                	je     c01034bd <buddy_free_pages+0xba>
   allocpages=fixsize(n);
c01034ad:	8b 45 0c             	mov    0xc(%ebp),%eax
c01034b0:	89 04 24             	mov    %eax,(%esp)
c01034b3:	e8 2a f8 ff ff       	call   c0102ce2 <fixsize>
c01034b8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01034bb:	eb 06                	jmp    c01034c3 <buddy_free_pages+0xc0>
  else
  {
     allocpages=n;
c01034bd:	8b 45 0c             	mov    0xc(%ebp),%eax
c01034c0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  }
  assert(self && offset >= 0 && offset < self->size);//是否合法
c01034c3:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c01034c7:	74 12                	je     c01034db <buddy_free_pages+0xd8>
c01034c9:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c01034cd:	78 0c                	js     c01034db <buddy_free_pages+0xd8>
c01034cf:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01034d2:	8b 10                	mov    (%eax),%edx
c01034d4:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01034d7:	39 c2                	cmp    %eax,%edx
c01034d9:	77 24                	ja     c01034ff <buddy_free_pages+0xfc>
c01034db:	c7 44 24 0c 90 9c 10 	movl   $0xc0109c90,0xc(%esp)
c01034e2:	c0 
c01034e3:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c01034ea:	c0 
c01034eb:	c7 44 24 04 ca 00 00 	movl   $0xca,0x4(%esp)
c01034f2:	00 
c01034f3:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c01034fa:	e8 22 cf ff ff       	call   c0100421 <__panic>
  node_size = 1;
c01034ff:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
  index = offset + self->size - 1;
c0103506:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103509:	8b 10                	mov    (%eax),%edx
c010350b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010350e:	01 d0                	add    %edx,%eax
c0103510:	48                   	dec    %eax
c0103511:	89 45 f0             	mov    %eax,-0x10(%ebp)
  nr_free+=allocpages;//更新空闲页的数量
c0103514:	8b 15 e8 33 1c c0    	mov    0xc01c33e8,%edx
c010351a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010351d:	01 d0                	add    %edx,%eax
c010351f:	a3 e8 33 1c c0       	mov    %eax,0xc01c33e8
  struct Page* p;
  self[index].longest = allocpages;
c0103524:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103527:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
c010352e:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103531:	01 c2                	add    %eax,%edx
c0103533:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103536:	89 42 04             	mov    %eax,0x4(%edx)
  for(i=0;i<allocpages;i++)//回收已分配的页
c0103539:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0103540:	eb 49                	jmp    c010358b <buddy_free_pages+0x188>
  {
     p=le2page(le,page_link);
c0103542:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103545:	83 e8 0c             	sub    $0xc,%eax
c0103548:	89 45 cc             	mov    %eax,-0x34(%ebp)
     p->flags=0;
c010354b:	8b 45 cc             	mov    -0x34(%ebp),%eax
c010354e:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
     p->property=1;
c0103555:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0103558:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
     SetPageProperty(p);
c010355f:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0103562:	83 c0 04             	add    $0x4,%eax
c0103565:	c7 45 bc 01 00 00 00 	movl   $0x1,-0x44(%ebp)
c010356c:	89 45 b8             	mov    %eax,-0x48(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c010356f:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0103572:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0103575:	0f ab 10             	bts    %edx,(%eax)
}
c0103578:	90                   	nop
c0103579:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010357c:	89 45 c0             	mov    %eax,-0x40(%ebp)
c010357f:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0103582:	8b 40 04             	mov    0x4(%eax),%eax
     le=list_next(le);
c0103585:	89 45 ec             	mov    %eax,-0x14(%ebp)
  for(i=0;i<allocpages;i++)//回收已分配的页
c0103588:	ff 45 e8             	incl   -0x18(%ebp)
c010358b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010358e:	3b 45 e4             	cmp    -0x1c(%ebp),%eax
c0103591:	7c af                	jl     c0103542 <buddy_free_pages+0x13f>
  }
  //node_size=allocpages;
  while (index) {//向上合并，修改先祖节点的记录值
c0103593:	eb 75                	jmp    c010360a <buddy_free_pages+0x207>
    index = PARENT(index);
c0103595:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103598:	40                   	inc    %eax
c0103599:	d1 e8                	shr    %eax
c010359b:	48                   	dec    %eax
c010359c:	89 45 f0             	mov    %eax,-0x10(%ebp)
    node_size *= 2;
c010359f:	d1 65 f4             	shll   -0xc(%ebp)

    left_longest = self[LEFT_LEAF(index)].longest;
c01035a2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01035a5:	c1 e0 04             	shl    $0x4,%eax
c01035a8:	8d 50 08             	lea    0x8(%eax),%edx
c01035ab:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01035ae:	01 d0                	add    %edx,%eax
c01035b0:	8b 40 04             	mov    0x4(%eax),%eax
c01035b3:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    right_longest = self[RIGHT_LEAF(index)].longest;
c01035b6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01035b9:	40                   	inc    %eax
c01035ba:	c1 e0 04             	shl    $0x4,%eax
c01035bd:	89 c2                	mov    %eax,%edx
c01035bf:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01035c2:	01 d0                	add    %edx,%eax
c01035c4:	8b 40 04             	mov    0x4(%eax),%eax
c01035c7:	89 45 d0             	mov    %eax,-0x30(%ebp)
    
    if (left_longest + right_longest == node_size) 
c01035ca:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01035cd:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01035d0:	01 d0                	add    %edx,%eax
c01035d2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c01035d5:	75 17                	jne    c01035ee <buddy_free_pages+0x1eb>
      self[index].longest = node_size;
c01035d7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01035da:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
c01035e1:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01035e4:	01 c2                	add    %eax,%edx
c01035e6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01035e9:	89 42 04             	mov    %eax,0x4(%edx)
c01035ec:	eb 1c                	jmp    c010360a <buddy_free_pages+0x207>
    else
      self[index].longest = MAX(left_longest, right_longest);
c01035ee:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01035f1:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
c01035f8:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01035fb:	01 c2                	add    %eax,%edx
c01035fd:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0103600:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c0103603:	0f 43 45 d0          	cmovae -0x30(%ebp),%eax
c0103607:	89 42 04             	mov    %eax,0x4(%edx)
  while (index) {//向上合并，修改先祖节点的记录值
c010360a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010360e:	75 85                	jne    c0103595 <buddy_free_pages+0x192>
  }
  for(i=pos;i<nr_block-1;i++)//清除此次的分配记录
c0103610:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0103613:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0103616:	eb 39                	jmp    c0103651 <buddy_free_pages+0x24e>
  {
    rec[i]=rec[i+1];
c0103618:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010361b:	8d 48 01             	lea    0x1(%eax),%ecx
c010361e:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0103621:	89 d0                	mov    %edx,%eax
c0103623:	01 c0                	add    %eax,%eax
c0103625:	01 d0                	add    %edx,%eax
c0103627:	c1 e0 02             	shl    $0x2,%eax
c010362a:	8d 90 00 34 1c c0    	lea    -0x3fe3cc00(%eax),%edx
c0103630:	89 c8                	mov    %ecx,%eax
c0103632:	01 c0                	add    %eax,%eax
c0103634:	01 c8                	add    %ecx,%eax
c0103636:	c1 e0 02             	shl    $0x2,%eax
c0103639:	05 00 34 1c c0       	add    $0xc01c3400,%eax
c010363e:	8b 08                	mov    (%eax),%ecx
c0103640:	89 0a                	mov    %ecx,(%edx)
c0103642:	8b 48 04             	mov    0x4(%eax),%ecx
c0103645:	89 4a 04             	mov    %ecx,0x4(%edx)
c0103648:	8b 40 08             	mov    0x8(%eax),%eax
c010364b:	89 42 08             	mov    %eax,0x8(%edx)
  for(i=pos;i<nr_block-1;i++)//清除此次的分配记录
c010364e:	ff 45 e8             	incl   -0x18(%ebp)
c0103651:	a1 c0 6f 12 c0       	mov    0xc0126fc0,%eax
c0103656:	48                   	dec    %eax
c0103657:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c010365a:	7c bc                	jl     c0103618 <buddy_free_pages+0x215>
  }
  nr_block--;//更新分配块数的值
c010365c:	a1 c0 6f 12 c0       	mov    0xc0126fc0,%eax
c0103661:	48                   	dec    %eax
c0103662:	a3 c0 6f 12 c0       	mov    %eax,0xc0126fc0
}
c0103667:	90                   	nop
c0103668:	c9                   	leave  
c0103669:	c3                   	ret    

c010366a <buddy_nr_free_pages>:

static size_t
buddy_nr_free_pages(void) {
c010366a:	f3 0f 1e fb          	endbr32 
c010366e:	55                   	push   %ebp
c010366f:	89 e5                	mov    %esp,%ebp
    return nr_free;
c0103671:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
}
c0103676:	5d                   	pop    %ebp
c0103677:	c3                   	ret    

c0103678 <buddy_check>:

//以下是一个测试函数
static void

buddy_check(void) {
c0103678:	f3 0f 1e fb          	endbr32 
c010367c:	55                   	push   %ebp
c010367d:	89 e5                	mov    %esp,%ebp
c010367f:	83 ec 38             	sub    $0x38,%esp
    struct Page *p0, *A, *B,*C,*D;
    p0 = A = B = C = D =NULL;
c0103682:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0103689:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010368c:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010368f:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103692:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0103695:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103698:	89 45 e8             	mov    %eax,-0x18(%ebp)
c010369b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010369e:	89 45 e4             	mov    %eax,-0x1c(%ebp)

    assert((p0 = alloc_page()) != NULL);
c01036a1:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01036a8:	e8 2a 07 00 00       	call   c0103dd7 <alloc_pages>
c01036ad:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01036b0:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01036b4:	75 24                	jne    c01036da <buddy_check+0x62>
c01036b6:	c7 44 24 0c bb 9c 10 	movl   $0xc0109cbb,0xc(%esp)
c01036bd:	c0 
c01036be:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c01036c5:	c0 
c01036c6:	c7 44 24 04 f8 00 00 	movl   $0xf8,0x4(%esp)
c01036cd:	00 
c01036ce:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c01036d5:	e8 47 cd ff ff       	call   c0100421 <__panic>
    assert((A = alloc_page()) != NULL);
c01036da:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01036e1:	e8 f1 06 00 00       	call   c0103dd7 <alloc_pages>
c01036e6:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01036e9:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01036ed:	75 24                	jne    c0103713 <buddy_check+0x9b>
c01036ef:	c7 44 24 0c d7 9c 10 	movl   $0xc0109cd7,0xc(%esp)
c01036f6:	c0 
c01036f7:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c01036fe:	c0 
c01036ff:	c7 44 24 04 f9 00 00 	movl   $0xf9,0x4(%esp)
c0103706:	00 
c0103707:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c010370e:	e8 0e cd ff ff       	call   c0100421 <__panic>
    assert((B = alloc_page()) != NULL);
c0103713:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010371a:	e8 b8 06 00 00       	call   c0103dd7 <alloc_pages>
c010371f:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0103722:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0103726:	75 24                	jne    c010374c <buddy_check+0xd4>
c0103728:	c7 44 24 0c f2 9c 10 	movl   $0xc0109cf2,0xc(%esp)
c010372f:	c0 
c0103730:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c0103737:	c0 
c0103738:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
c010373f:	00 
c0103740:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c0103747:	e8 d5 cc ff ff       	call   c0100421 <__panic>

    assert(p0 != A && p0 != B && A != B);
c010374c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010374f:	3b 45 e8             	cmp    -0x18(%ebp),%eax
c0103752:	74 10                	je     c0103764 <buddy_check+0xec>
c0103754:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103757:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c010375a:	74 08                	je     c0103764 <buddy_check+0xec>
c010375c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010375f:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0103762:	75 24                	jne    c0103788 <buddy_check+0x110>
c0103764:	c7 44 24 0c 0d 9d 10 	movl   $0xc0109d0d,0xc(%esp)
c010376b:	c0 
c010376c:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c0103773:	c0 
c0103774:	c7 44 24 04 fc 00 00 	movl   $0xfc,0x4(%esp)
c010377b:	00 
c010377c:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c0103783:	e8 99 cc ff ff       	call   c0100421 <__panic>
    assert(page_ref(p0) == 0 && page_ref(A) == 0 && page_ref(B) == 0);
c0103788:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010378b:	89 04 24             	mov    %eax,(%esp)
c010378e:	e8 37 f5 ff ff       	call   c0102cca <page_ref>
c0103793:	85 c0                	test   %eax,%eax
c0103795:	75 1e                	jne    c01037b5 <buddy_check+0x13d>
c0103797:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010379a:	89 04 24             	mov    %eax,(%esp)
c010379d:	e8 28 f5 ff ff       	call   c0102cca <page_ref>
c01037a2:	85 c0                	test   %eax,%eax
c01037a4:	75 0f                	jne    c01037b5 <buddy_check+0x13d>
c01037a6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01037a9:	89 04 24             	mov    %eax,(%esp)
c01037ac:	e8 19 f5 ff ff       	call   c0102cca <page_ref>
c01037b1:	85 c0                	test   %eax,%eax
c01037b3:	74 24                	je     c01037d9 <buddy_check+0x161>
c01037b5:	c7 44 24 0c 2c 9d 10 	movl   $0xc0109d2c,0xc(%esp)
c01037bc:	c0 
c01037bd:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c01037c4:	c0 
c01037c5:	c7 44 24 04 fd 00 00 	movl   $0xfd,0x4(%esp)
c01037cc:	00 
c01037cd:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c01037d4:	e8 48 cc ff ff       	call   c0100421 <__panic>
    free_page(p0);
c01037d9:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01037e0:	00 
c01037e1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01037e4:	89 04 24             	mov    %eax,(%esp)
c01037e7:	e8 27 06 00 00       	call   c0103e13 <free_pages>
    free_page(A);
c01037ec:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01037f3:	00 
c01037f4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01037f7:	89 04 24             	mov    %eax,(%esp)
c01037fa:	e8 14 06 00 00       	call   c0103e13 <free_pages>
    free_page(B);
c01037ff:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0103806:	00 
c0103807:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010380a:	89 04 24             	mov    %eax,(%esp)
c010380d:	e8 01 06 00 00       	call   c0103e13 <free_pages>
    
    A=alloc_pages(500);
c0103812:	c7 04 24 f4 01 00 00 	movl   $0x1f4,(%esp)
c0103819:	e8 b9 05 00 00       	call   c0103dd7 <alloc_pages>
c010381e:	89 45 e8             	mov    %eax,-0x18(%ebp)
    B=alloc_pages(500);
c0103821:	c7 04 24 f4 01 00 00 	movl   $0x1f4,(%esp)
c0103828:	e8 aa 05 00 00       	call   c0103dd7 <alloc_pages>
c010382d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    cprintf("A %p\n",A);
c0103830:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103833:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103837:	c7 04 24 66 9d 10 c0 	movl   $0xc0109d66,(%esp)
c010383e:	e8 72 ca ff ff       	call   c01002b5 <cprintf>
    cprintf("B %p\n",B);
c0103843:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103846:	89 44 24 04          	mov    %eax,0x4(%esp)
c010384a:	c7 04 24 6c 9d 10 c0 	movl   $0xc0109d6c,(%esp)
c0103851:	e8 5f ca ff ff       	call   c01002b5 <cprintf>
    free_pages(A,250);
c0103856:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
c010385d:	00 
c010385e:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103861:	89 04 24             	mov    %eax,(%esp)
c0103864:	e8 aa 05 00 00       	call   c0103e13 <free_pages>
    free_pages(B,500);
c0103869:	c7 44 24 04 f4 01 00 	movl   $0x1f4,0x4(%esp)
c0103870:	00 
c0103871:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103874:	89 04 24             	mov    %eax,(%esp)
c0103877:	e8 97 05 00 00       	call   c0103e13 <free_pages>
    free_pages(A+250,250);
c010387c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010387f:	05 28 23 00 00       	add    $0x2328,%eax
c0103884:	c7 44 24 04 fa 00 00 	movl   $0xfa,0x4(%esp)
c010388b:	00 
c010388c:	89 04 24             	mov    %eax,(%esp)
c010388f:	e8 7f 05 00 00       	call   c0103e13 <free_pages>
    
    p0=alloc_pages(1024);
c0103894:	c7 04 24 00 04 00 00 	movl   $0x400,(%esp)
c010389b:	e8 37 05 00 00       	call   c0103dd7 <alloc_pages>
c01038a0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    cprintf("p0 %p\n",p0);
c01038a3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01038a6:	89 44 24 04          	mov    %eax,0x4(%esp)
c01038aa:	c7 04 24 72 9d 10 c0 	movl   $0xc0109d72,(%esp)
c01038b1:	e8 ff c9 ff ff       	call   c01002b5 <cprintf>
    assert(p0 == A);
c01038b6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01038b9:	3b 45 e8             	cmp    -0x18(%ebp),%eax
c01038bc:	74 24                	je     c01038e2 <buddy_check+0x26a>
c01038be:	c7 44 24 0c 79 9d 10 	movl   $0xc0109d79,0xc(%esp)
c01038c5:	c0 
c01038c6:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c01038cd:	c0 
c01038ce:	c7 44 24 04 0c 01 00 	movl   $0x10c,0x4(%esp)
c01038d5:	00 
c01038d6:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c01038dd:	e8 3f cb ff ff       	call   c0100421 <__panic>
    //以下是根据链接中的样例测试编写的
    A=alloc_pages(70);  
c01038e2:	c7 04 24 46 00 00 00 	movl   $0x46,(%esp)
c01038e9:	e8 e9 04 00 00       	call   c0103dd7 <alloc_pages>
c01038ee:	89 45 e8             	mov    %eax,-0x18(%ebp)
    B=alloc_pages(35);
c01038f1:	c7 04 24 23 00 00 00 	movl   $0x23,(%esp)
c01038f8:	e8 da 04 00 00       	call   c0103dd7 <alloc_pages>
c01038fd:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(A+128==B);//检查是否相邻
c0103900:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103903:	05 00 12 00 00       	add    $0x1200,%eax
c0103908:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c010390b:	74 24                	je     c0103931 <buddy_check+0x2b9>
c010390d:	c7 44 24 0c 81 9d 10 	movl   $0xc0109d81,0xc(%esp)
c0103914:	c0 
c0103915:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c010391c:	c0 
c010391d:	c7 44 24 04 10 01 00 	movl   $0x110,0x4(%esp)
c0103924:	00 
c0103925:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c010392c:	e8 f0 ca ff ff       	call   c0100421 <__panic>
    cprintf("A %p\n",A);
c0103931:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103934:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103938:	c7 04 24 66 9d 10 c0 	movl   $0xc0109d66,(%esp)
c010393f:	e8 71 c9 ff ff       	call   c01002b5 <cprintf>
    cprintf("B %p\n",B);
c0103944:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103947:	89 44 24 04          	mov    %eax,0x4(%esp)
c010394b:	c7 04 24 6c 9d 10 c0 	movl   $0xc0109d6c,(%esp)
c0103952:	e8 5e c9 ff ff       	call   c01002b5 <cprintf>
    C=alloc_pages(80);
c0103957:	c7 04 24 50 00 00 00 	movl   $0x50,(%esp)
c010395e:	e8 74 04 00 00       	call   c0103dd7 <alloc_pages>
c0103963:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(A+256==C);//检查C有没有和A重叠
c0103966:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0103969:	05 00 24 00 00       	add    $0x2400,%eax
c010396e:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0103971:	74 24                	je     c0103997 <buddy_check+0x31f>
c0103973:	c7 44 24 0c 8a 9d 10 	movl   $0xc0109d8a,0xc(%esp)
c010397a:	c0 
c010397b:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c0103982:	c0 
c0103983:	c7 44 24 04 14 01 00 	movl   $0x114,0x4(%esp)
c010398a:	00 
c010398b:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c0103992:	e8 8a ca ff ff       	call   c0100421 <__panic>
    cprintf("C %p\n",C);
c0103997:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010399a:	89 44 24 04          	mov    %eax,0x4(%esp)
c010399e:	c7 04 24 93 9d 10 c0 	movl   $0xc0109d93,(%esp)
c01039a5:	e8 0b c9 ff ff       	call   c01002b5 <cprintf>
    free_pages(A,70);//释放A
c01039aa:	c7 44 24 04 46 00 00 	movl   $0x46,0x4(%esp)
c01039b1:	00 
c01039b2:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01039b5:	89 04 24             	mov    %eax,(%esp)
c01039b8:	e8 56 04 00 00       	call   c0103e13 <free_pages>
    cprintf("B %p\n",B);
c01039bd:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01039c0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01039c4:	c7 04 24 6c 9d 10 c0 	movl   $0xc0109d6c,(%esp)
c01039cb:	e8 e5 c8 ff ff       	call   c01002b5 <cprintf>
    D=alloc_pages(60);
c01039d0:	c7 04 24 3c 00 00 00 	movl   $0x3c,(%esp)
c01039d7:	e8 fb 03 00 00       	call   c0103dd7 <alloc_pages>
c01039dc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("D %p\n",D);
c01039df:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01039e2:	89 44 24 04          	mov    %eax,0x4(%esp)
c01039e6:	c7 04 24 99 9d 10 c0 	movl   $0xc0109d99,(%esp)
c01039ed:	e8 c3 c8 ff ff       	call   c01002b5 <cprintf>
    assert(B+64==D);//检查B，D是否相邻
c01039f2:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01039f5:	05 00 09 00 00       	add    $0x900,%eax
c01039fa:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c01039fd:	74 24                	je     c0103a23 <buddy_check+0x3ab>
c01039ff:	c7 44 24 0c 9f 9d 10 	movl   $0xc0109d9f,0xc(%esp)
c0103a06:	c0 
c0103a07:	c7 44 24 08 54 9c 10 	movl   $0xc0109c54,0x8(%esp)
c0103a0e:	c0 
c0103a0f:	c7 44 24 04 1a 01 00 	movl   $0x11a,0x4(%esp)
c0103a16:	00 
c0103a17:	c7 04 24 69 9c 10 c0 	movl   $0xc0109c69,(%esp)
c0103a1e:	e8 fe c9 ff ff       	call   c0100421 <__panic>
    free_pages(B,35);
c0103a23:	c7 44 24 04 23 00 00 	movl   $0x23,0x4(%esp)
c0103a2a:	00 
c0103a2b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0103a2e:	89 04 24             	mov    %eax,(%esp)
c0103a31:	e8 dd 03 00 00       	call   c0103e13 <free_pages>
    cprintf("D %p\n",D);
c0103a36:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103a39:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103a3d:	c7 04 24 99 9d 10 c0 	movl   $0xc0109d99,(%esp)
c0103a44:	e8 6c c8 ff ff       	call   c01002b5 <cprintf>
    free_pages(D,60);
c0103a49:	c7 44 24 04 3c 00 00 	movl   $0x3c,0x4(%esp)
c0103a50:	00 
c0103a51:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103a54:	89 04 24             	mov    %eax,(%esp)
c0103a57:	e8 b7 03 00 00       	call   c0103e13 <free_pages>
    cprintf("C %p\n",C);
c0103a5c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103a5f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103a63:	c7 04 24 93 9d 10 c0 	movl   $0xc0109d93,(%esp)
c0103a6a:	e8 46 c8 ff ff       	call   c01002b5 <cprintf>
    free_pages(C,80);
c0103a6f:	c7 44 24 04 50 00 00 	movl   $0x50,0x4(%esp)
c0103a76:	00 
c0103a77:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103a7a:	89 04 24             	mov    %eax,(%esp)
c0103a7d:	e8 91 03 00 00       	call   c0103e13 <free_pages>
    free_pages(p0,1000);//全部释放
c0103a82:	c7 44 24 04 e8 03 00 	movl   $0x3e8,0x4(%esp)
c0103a89:	00 
c0103a8a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0103a8d:	89 04 24             	mov    %eax,(%esp)
c0103a90:	e8 7e 03 00 00       	call   c0103e13 <free_pages>
}
c0103a95:	90                   	nop
c0103a96:	c9                   	leave  
c0103a97:	c3                   	ret    

c0103a98 <page2ppn>:
page2ppn(struct Page *page) {
c0103a98:	55                   	push   %ebp
c0103a99:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0103a9b:	a1 08 da 2a c0       	mov    0xc02ada08,%eax
c0103aa0:	8b 55 08             	mov    0x8(%ebp),%edx
c0103aa3:	29 c2                	sub    %eax,%edx
c0103aa5:	89 d0                	mov    %edx,%eax
c0103aa7:	c1 f8 02             	sar    $0x2,%eax
c0103aaa:	69 c0 39 8e e3 38    	imul   $0x38e38e39,%eax,%eax
}
c0103ab0:	5d                   	pop    %ebp
c0103ab1:	c3                   	ret    

c0103ab2 <page2pa>:
page2pa(struct Page *page) {
c0103ab2:	55                   	push   %ebp
c0103ab3:	89 e5                	mov    %esp,%ebp
c0103ab5:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c0103ab8:	8b 45 08             	mov    0x8(%ebp),%eax
c0103abb:	89 04 24             	mov    %eax,(%esp)
c0103abe:	e8 d5 ff ff ff       	call   c0103a98 <page2ppn>
c0103ac3:	c1 e0 0c             	shl    $0xc,%eax
}
c0103ac6:	c9                   	leave  
c0103ac7:	c3                   	ret    

c0103ac8 <pa2page>:
pa2page(uintptr_t pa) {
c0103ac8:	55                   	push   %ebp
c0103ac9:	89 e5                	mov    %esp,%ebp
c0103acb:	83 ec 18             	sub    $0x18,%esp
    if (PPN(pa) >= npage) {
c0103ace:	8b 45 08             	mov    0x8(%ebp),%eax
c0103ad1:	c1 e8 0c             	shr    $0xc,%eax
c0103ad4:	89 c2                	mov    %eax,%edx
c0103ad6:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c0103adb:	39 c2                	cmp    %eax,%edx
c0103add:	72 1c                	jb     c0103afb <pa2page+0x33>
        panic("pa2page called with invalid pa");
c0103adf:	c7 44 24 08 d8 9d 10 	movl   $0xc0109dd8,0x8(%esp)
c0103ae6:	c0 
c0103ae7:	c7 44 24 04 5a 00 00 	movl   $0x5a,0x4(%esp)
c0103aee:	00 
c0103aef:	c7 04 24 f7 9d 10 c0 	movl   $0xc0109df7,(%esp)
c0103af6:	e8 26 c9 ff ff       	call   c0100421 <__panic>
    return &pages[PPN(pa)];
c0103afb:	8b 0d 08 da 2a c0    	mov    0xc02ada08,%ecx
c0103b01:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b04:	c1 e8 0c             	shr    $0xc,%eax
c0103b07:	89 c2                	mov    %eax,%edx
c0103b09:	89 d0                	mov    %edx,%eax
c0103b0b:	c1 e0 03             	shl    $0x3,%eax
c0103b0e:	01 d0                	add    %edx,%eax
c0103b10:	c1 e0 02             	shl    $0x2,%eax
c0103b13:	01 c8                	add    %ecx,%eax
}
c0103b15:	c9                   	leave  
c0103b16:	c3                   	ret    

c0103b17 <page2kva>:
page2kva(struct Page *page) {
c0103b17:	55                   	push   %ebp
c0103b18:	89 e5                	mov    %esp,%ebp
c0103b1a:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
c0103b1d:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b20:	89 04 24             	mov    %eax,(%esp)
c0103b23:	e8 8a ff ff ff       	call   c0103ab2 <page2pa>
c0103b28:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0103b2b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b2e:	c1 e8 0c             	shr    $0xc,%eax
c0103b31:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0103b34:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c0103b39:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0103b3c:	72 23                	jb     c0103b61 <page2kva+0x4a>
c0103b3e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b41:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0103b45:	c7 44 24 08 08 9e 10 	movl   $0xc0109e08,0x8(%esp)
c0103b4c:	c0 
c0103b4d:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
c0103b54:	00 
c0103b55:	c7 04 24 f7 9d 10 c0 	movl   $0xc0109df7,(%esp)
c0103b5c:	e8 c0 c8 ff ff       	call   c0100421 <__panic>
c0103b61:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103b64:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
c0103b69:	c9                   	leave  
c0103b6a:	c3                   	ret    

c0103b6b <pte2page>:
pte2page(pte_t pte) {
c0103b6b:	55                   	push   %ebp
c0103b6c:	89 e5                	mov    %esp,%ebp
c0103b6e:	83 ec 18             	sub    $0x18,%esp
    if (!(pte & PTE_P)) {
c0103b71:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b74:	83 e0 01             	and    $0x1,%eax
c0103b77:	85 c0                	test   %eax,%eax
c0103b79:	75 1c                	jne    c0103b97 <pte2page+0x2c>
        panic("pte2page called with invalid pte");
c0103b7b:	c7 44 24 08 2c 9e 10 	movl   $0xc0109e2c,0x8(%esp)
c0103b82:	c0 
c0103b83:	c7 44 24 04 6c 00 00 	movl   $0x6c,0x4(%esp)
c0103b8a:	00 
c0103b8b:	c7 04 24 f7 9d 10 c0 	movl   $0xc0109df7,(%esp)
c0103b92:	e8 8a c8 ff ff       	call   c0100421 <__panic>
    return pa2page(PTE_ADDR(pte));
c0103b97:	8b 45 08             	mov    0x8(%ebp),%eax
c0103b9a:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103b9f:	89 04 24             	mov    %eax,(%esp)
c0103ba2:	e8 21 ff ff ff       	call   c0103ac8 <pa2page>
}
c0103ba7:	c9                   	leave  
c0103ba8:	c3                   	ret    

c0103ba9 <pde2page>:
pde2page(pde_t pde) {
c0103ba9:	55                   	push   %ebp
c0103baa:	89 e5                	mov    %esp,%ebp
c0103bac:	83 ec 18             	sub    $0x18,%esp
    return pa2page(PDE_ADDR(pde));
c0103baf:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bb2:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0103bb7:	89 04 24             	mov    %eax,(%esp)
c0103bba:	e8 09 ff ff ff       	call   c0103ac8 <pa2page>
}
c0103bbf:	c9                   	leave  
c0103bc0:	c3                   	ret    

c0103bc1 <page_ref>:
page_ref(struct Page *page) {
c0103bc1:	55                   	push   %ebp
c0103bc2:	89 e5                	mov    %esp,%ebp
    return page->ref;
c0103bc4:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bc7:	8b 00                	mov    (%eax),%eax
}
c0103bc9:	5d                   	pop    %ebp
c0103bca:	c3                   	ret    

c0103bcb <set_page_ref>:
set_page_ref(struct Page *page, int val) {
c0103bcb:	55                   	push   %ebp
c0103bcc:	89 e5                	mov    %esp,%ebp
    page->ref = val;
c0103bce:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bd1:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103bd4:	89 10                	mov    %edx,(%eax)
}
c0103bd6:	90                   	nop
c0103bd7:	5d                   	pop    %ebp
c0103bd8:	c3                   	ret    

c0103bd9 <page_ref_inc>:

static inline int
page_ref_inc(struct Page *page) {
c0103bd9:	55                   	push   %ebp
c0103bda:	89 e5                	mov    %esp,%ebp
    page->ref += 1;
c0103bdc:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bdf:	8b 00                	mov    (%eax),%eax
c0103be1:	8d 50 01             	lea    0x1(%eax),%edx
c0103be4:	8b 45 08             	mov    0x8(%ebp),%eax
c0103be7:	89 10                	mov    %edx,(%eax)
    return page->ref;
c0103be9:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bec:	8b 00                	mov    (%eax),%eax
}
c0103bee:	5d                   	pop    %ebp
c0103bef:	c3                   	ret    

c0103bf0 <page_ref_dec>:

static inline int
page_ref_dec(struct Page *page) {
c0103bf0:	55                   	push   %ebp
c0103bf1:	89 e5                	mov    %esp,%ebp
    page->ref -= 1;
c0103bf3:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bf6:	8b 00                	mov    (%eax),%eax
c0103bf8:	8d 50 ff             	lea    -0x1(%eax),%edx
c0103bfb:	8b 45 08             	mov    0x8(%ebp),%eax
c0103bfe:	89 10                	mov    %edx,(%eax)
    return page->ref;
c0103c00:	8b 45 08             	mov    0x8(%ebp),%eax
c0103c03:	8b 00                	mov    (%eax),%eax
}
c0103c05:	5d                   	pop    %ebp
c0103c06:	c3                   	ret    

c0103c07 <__intr_save>:
__intr_save(void) {
c0103c07:	55                   	push   %ebp
c0103c08:	89 e5                	mov    %esp,%ebp
c0103c0a:	83 ec 18             	sub    $0x18,%esp
    asm volatile ("pushfl; popl %0" : "=r" (eflags));
c0103c0d:	9c                   	pushf  
c0103c0e:	58                   	pop    %eax
c0103c0f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    return eflags;
c0103c12:	8b 45 f4             	mov    -0xc(%ebp),%eax
    if (read_eflags() & FL_IF) {
c0103c15:	25 00 02 00 00       	and    $0x200,%eax
c0103c1a:	85 c0                	test   %eax,%eax
c0103c1c:	74 0c                	je     c0103c2a <__intr_save+0x23>
        intr_disable();
c0103c1e:	e8 6d dd ff ff       	call   c0101990 <intr_disable>
        return 1;
c0103c23:	b8 01 00 00 00       	mov    $0x1,%eax
c0103c28:	eb 05                	jmp    c0103c2f <__intr_save+0x28>
    return 0;
c0103c2a:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0103c2f:	c9                   	leave  
c0103c30:	c3                   	ret    

c0103c31 <__intr_restore>:
__intr_restore(bool flag) {
c0103c31:	55                   	push   %ebp
c0103c32:	89 e5                	mov    %esp,%ebp
c0103c34:	83 ec 08             	sub    $0x8,%esp
    if (flag) {
c0103c37:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0103c3b:	74 05                	je     c0103c42 <__intr_restore+0x11>
        intr_enable();
c0103c3d:	e8 42 dd ff ff       	call   c0101984 <intr_enable>
}
c0103c42:	90                   	nop
c0103c43:	c9                   	leave  
c0103c44:	c3                   	ret    

c0103c45 <lgdt>:
/* *
 * lgdt - load the global descriptor table register and reset the
 * data/code segement registers for kernel.
 * */
static inline void
lgdt(struct pseudodesc *pd) {
c0103c45:	55                   	push   %ebp
c0103c46:	89 e5                	mov    %esp,%ebp
    asm volatile ("lgdt (%0)" :: "r" (pd));
c0103c48:	8b 45 08             	mov    0x8(%ebp),%eax
c0103c4b:	0f 01 10             	lgdtl  (%eax)
    asm volatile ("movw %%ax, %%gs" :: "a" (USER_DS));
c0103c4e:	b8 23 00 00 00       	mov    $0x23,%eax
c0103c53:	8e e8                	mov    %eax,%gs
    asm volatile ("movw %%ax, %%fs" :: "a" (USER_DS));
c0103c55:	b8 23 00 00 00       	mov    $0x23,%eax
c0103c5a:	8e e0                	mov    %eax,%fs
    asm volatile ("movw %%ax, %%es" :: "a" (KERNEL_DS));
c0103c5c:	b8 10 00 00 00       	mov    $0x10,%eax
c0103c61:	8e c0                	mov    %eax,%es
    asm volatile ("movw %%ax, %%ds" :: "a" (KERNEL_DS));
c0103c63:	b8 10 00 00 00       	mov    $0x10,%eax
c0103c68:	8e d8                	mov    %eax,%ds
    asm volatile ("movw %%ax, %%ss" :: "a" (KERNEL_DS));
c0103c6a:	b8 10 00 00 00       	mov    $0x10,%eax
c0103c6f:	8e d0                	mov    %eax,%ss
    // reload cs
    asm volatile ("ljmp %0, $1f\n 1:\n" :: "i" (KERNEL_CS));
c0103c71:	ea 78 3c 10 c0 08 00 	ljmp   $0x8,$0xc0103c78
}
c0103c78:	90                   	nop
c0103c79:	5d                   	pop    %ebp
c0103c7a:	c3                   	ret    

c0103c7b <load_esp0>:
 * load_esp0 - change the ESP0 in default task state segment,
 * so that we can use different kernel stack when we trap frame
 * user to kernel.
 * */
void
load_esp0(uintptr_t esp0) {
c0103c7b:	f3 0f 1e fb          	endbr32 
c0103c7f:	55                   	push   %ebp
c0103c80:	89 e5                	mov    %esp,%ebp
    ts.ts_esp0 = esp0;
c0103c82:	8b 45 08             	mov    0x8(%ebp),%eax
c0103c85:	a3 a4 6e 12 c0       	mov    %eax,0xc0126ea4
}
c0103c8a:	90                   	nop
c0103c8b:	5d                   	pop    %ebp
c0103c8c:	c3                   	ret    

c0103c8d <gdt_init>:

/* gdt_init - initialize the default GDT and TSS */
static void
gdt_init(void) {
c0103c8d:	f3 0f 1e fb          	endbr32 
c0103c91:	55                   	push   %ebp
c0103c92:	89 e5                	mov    %esp,%ebp
c0103c94:	83 ec 14             	sub    $0x14,%esp
    // set boot kernel stack and default SS0
    load_esp0((uintptr_t)bootstacktop);
c0103c97:	b8 00 30 12 c0       	mov    $0xc0123000,%eax
c0103c9c:	89 04 24             	mov    %eax,(%esp)
c0103c9f:	e8 d7 ff ff ff       	call   c0103c7b <load_esp0>
    ts.ts_ss0 = KERNEL_DS;
c0103ca4:	66 c7 05 a8 6e 12 c0 	movw   $0x10,0xc0126ea8
c0103cab:	10 00 

    // initialize the TSS filed of the gdt
    gdt[SEG_TSS] = SEGTSS(STS_T32A, (uintptr_t)&ts, sizeof(ts), DPL_KERNEL);
c0103cad:	66 c7 05 28 3a 12 c0 	movw   $0x68,0xc0123a28
c0103cb4:	68 00 
c0103cb6:	b8 a0 6e 12 c0       	mov    $0xc0126ea0,%eax
c0103cbb:	0f b7 c0             	movzwl %ax,%eax
c0103cbe:	66 a3 2a 3a 12 c0    	mov    %ax,0xc0123a2a
c0103cc4:	b8 a0 6e 12 c0       	mov    $0xc0126ea0,%eax
c0103cc9:	c1 e8 10             	shr    $0x10,%eax
c0103ccc:	a2 2c 3a 12 c0       	mov    %al,0xc0123a2c
c0103cd1:	0f b6 05 2d 3a 12 c0 	movzbl 0xc0123a2d,%eax
c0103cd8:	24 f0                	and    $0xf0,%al
c0103cda:	0c 09                	or     $0x9,%al
c0103cdc:	a2 2d 3a 12 c0       	mov    %al,0xc0123a2d
c0103ce1:	0f b6 05 2d 3a 12 c0 	movzbl 0xc0123a2d,%eax
c0103ce8:	24 ef                	and    $0xef,%al
c0103cea:	a2 2d 3a 12 c0       	mov    %al,0xc0123a2d
c0103cef:	0f b6 05 2d 3a 12 c0 	movzbl 0xc0123a2d,%eax
c0103cf6:	24 9f                	and    $0x9f,%al
c0103cf8:	a2 2d 3a 12 c0       	mov    %al,0xc0123a2d
c0103cfd:	0f b6 05 2d 3a 12 c0 	movzbl 0xc0123a2d,%eax
c0103d04:	0c 80                	or     $0x80,%al
c0103d06:	a2 2d 3a 12 c0       	mov    %al,0xc0123a2d
c0103d0b:	0f b6 05 2e 3a 12 c0 	movzbl 0xc0123a2e,%eax
c0103d12:	24 f0                	and    $0xf0,%al
c0103d14:	a2 2e 3a 12 c0       	mov    %al,0xc0123a2e
c0103d19:	0f b6 05 2e 3a 12 c0 	movzbl 0xc0123a2e,%eax
c0103d20:	24 ef                	and    $0xef,%al
c0103d22:	a2 2e 3a 12 c0       	mov    %al,0xc0123a2e
c0103d27:	0f b6 05 2e 3a 12 c0 	movzbl 0xc0123a2e,%eax
c0103d2e:	24 df                	and    $0xdf,%al
c0103d30:	a2 2e 3a 12 c0       	mov    %al,0xc0123a2e
c0103d35:	0f b6 05 2e 3a 12 c0 	movzbl 0xc0123a2e,%eax
c0103d3c:	0c 40                	or     $0x40,%al
c0103d3e:	a2 2e 3a 12 c0       	mov    %al,0xc0123a2e
c0103d43:	0f b6 05 2e 3a 12 c0 	movzbl 0xc0123a2e,%eax
c0103d4a:	24 7f                	and    $0x7f,%al
c0103d4c:	a2 2e 3a 12 c0       	mov    %al,0xc0123a2e
c0103d51:	b8 a0 6e 12 c0       	mov    $0xc0126ea0,%eax
c0103d56:	c1 e8 18             	shr    $0x18,%eax
c0103d59:	a2 2f 3a 12 c0       	mov    %al,0xc0123a2f

    // reload all segment registers
    lgdt(&gdt_pd);
c0103d5e:	c7 04 24 30 3a 12 c0 	movl   $0xc0123a30,(%esp)
c0103d65:	e8 db fe ff ff       	call   c0103c45 <lgdt>
c0103d6a:	66 c7 45 fe 28 00    	movw   $0x28,-0x2(%ebp)
    asm volatile ("ltr %0" :: "r" (sel) : "memory");
c0103d70:	0f b7 45 fe          	movzwl -0x2(%ebp),%eax
c0103d74:	0f 00 d8             	ltr    %ax
}
c0103d77:	90                   	nop

    // load the TSS
    ltr(GD_TSS);
}
c0103d78:	90                   	nop
c0103d79:	c9                   	leave  
c0103d7a:	c3                   	ret    

c0103d7b <init_pmm_manager>:

//init_pmm_manager - initialize a pmm_manager instance
static void
init_pmm_manager(void) {
c0103d7b:	f3 0f 1e fb          	endbr32 
c0103d7f:	55                   	push   %ebp
c0103d80:	89 e5                	mov    %esp,%ebp
c0103d82:	83 ec 18             	sub    $0x18,%esp
    pmm_manager = &buddy_pmm_manager;
c0103d85:	c7 05 00 da 2a c0 a0 	movl   $0xc010afa0,0xc02ada00
c0103d8c:	af 10 c0 
    cprintf("memory management: %s\n", pmm_manager->name);
c0103d8f:	a1 00 da 2a c0       	mov    0xc02ada00,%eax
c0103d94:	8b 00                	mov    (%eax),%eax
c0103d96:	89 44 24 04          	mov    %eax,0x4(%esp)
c0103d9a:	c7 04 24 58 9e 10 c0 	movl   $0xc0109e58,(%esp)
c0103da1:	e8 0f c5 ff ff       	call   c01002b5 <cprintf>
    pmm_manager->init();
c0103da6:	a1 00 da 2a c0       	mov    0xc02ada00,%eax
c0103dab:	8b 40 04             	mov    0x4(%eax),%eax
c0103dae:	ff d0                	call   *%eax
}
c0103db0:	90                   	nop
c0103db1:	c9                   	leave  
c0103db2:	c3                   	ret    

c0103db3 <init_memmap>:

//init_memmap - call pmm->init_memmap to build Page struct for free memory  
static void
init_memmap(struct Page *base, size_t n) {
c0103db3:	f3 0f 1e fb          	endbr32 
c0103db7:	55                   	push   %ebp
c0103db8:	89 e5                	mov    %esp,%ebp
c0103dba:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->init_memmap(base, n);
c0103dbd:	a1 00 da 2a c0       	mov    0xc02ada00,%eax
c0103dc2:	8b 40 08             	mov    0x8(%eax),%eax
c0103dc5:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103dc8:	89 54 24 04          	mov    %edx,0x4(%esp)
c0103dcc:	8b 55 08             	mov    0x8(%ebp),%edx
c0103dcf:	89 14 24             	mov    %edx,(%esp)
c0103dd2:	ff d0                	call   *%eax
}
c0103dd4:	90                   	nop
c0103dd5:	c9                   	leave  
c0103dd6:	c3                   	ret    

c0103dd7 <alloc_pages>:

//alloc_pages - call pmm->alloc_pages to allocate a continuous n*PAGESIZE memory 
struct Page *
alloc_pages(size_t n) {
c0103dd7:	f3 0f 1e fb          	endbr32 
c0103ddb:	55                   	push   %ebp
c0103ddc:	89 e5                	mov    %esp,%ebp
c0103dde:	83 ec 28             	sub    $0x28,%esp
    struct Page *page=NULL;
c0103de1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    bool intr_flag;
    local_intr_save(intr_flag);
c0103de8:	e8 1a fe ff ff       	call   c0103c07 <__intr_save>
c0103ded:	89 45 f0             	mov    %eax,-0x10(%ebp)
    {
        page = pmm_manager->alloc_pages(n);
c0103df0:	a1 00 da 2a c0       	mov    0xc02ada00,%eax
c0103df5:	8b 40 0c             	mov    0xc(%eax),%eax
c0103df8:	8b 55 08             	mov    0x8(%ebp),%edx
c0103dfb:	89 14 24             	mov    %edx,(%esp)
c0103dfe:	ff d0                	call   *%eax
c0103e00:	89 45 f4             	mov    %eax,-0xc(%ebp)
    }
    local_intr_restore(intr_flag);
c0103e03:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0103e06:	89 04 24             	mov    %eax,(%esp)
c0103e09:	e8 23 fe ff ff       	call   c0103c31 <__intr_restore>
    return page;
c0103e0e:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0103e11:	c9                   	leave  
c0103e12:	c3                   	ret    

c0103e13 <free_pages>:

//free_pages - call pmm->free_pages to free a continuous n*PAGESIZE memory 
void
free_pages(struct Page *base, size_t n) {
c0103e13:	f3 0f 1e fb          	endbr32 
c0103e17:	55                   	push   %ebp
c0103e18:	89 e5                	mov    %esp,%ebp
c0103e1a:	83 ec 28             	sub    $0x28,%esp
    bool intr_flag;
    local_intr_save(intr_flag);
c0103e1d:	e8 e5 fd ff ff       	call   c0103c07 <__intr_save>
c0103e22:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        pmm_manager->free_pages(base, n);
c0103e25:	a1 00 da 2a c0       	mov    0xc02ada00,%eax
c0103e2a:	8b 40 10             	mov    0x10(%eax),%eax
c0103e2d:	8b 55 0c             	mov    0xc(%ebp),%edx
c0103e30:	89 54 24 04          	mov    %edx,0x4(%esp)
c0103e34:	8b 55 08             	mov    0x8(%ebp),%edx
c0103e37:	89 14 24             	mov    %edx,(%esp)
c0103e3a:	ff d0                	call   *%eax
    }
    local_intr_restore(intr_flag);
c0103e3c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103e3f:	89 04 24             	mov    %eax,(%esp)
c0103e42:	e8 ea fd ff ff       	call   c0103c31 <__intr_restore>
}
c0103e47:	90                   	nop
c0103e48:	c9                   	leave  
c0103e49:	c3                   	ret    

c0103e4a <nr_free_pages>:

//nr_free_pages - call pmm->nr_free_pages to get the size (nr*PAGESIZE) 
//of current free memory
size_t
nr_free_pages(void) {
c0103e4a:	f3 0f 1e fb          	endbr32 
c0103e4e:	55                   	push   %ebp
c0103e4f:	89 e5                	mov    %esp,%ebp
c0103e51:	83 ec 28             	sub    $0x28,%esp
    size_t ret;
    bool intr_flag;
    local_intr_save(intr_flag);
c0103e54:	e8 ae fd ff ff       	call   c0103c07 <__intr_save>
c0103e59:	89 45 f4             	mov    %eax,-0xc(%ebp)
    {
        ret = pmm_manager->nr_free_pages();
c0103e5c:	a1 00 da 2a c0       	mov    0xc02ada00,%eax
c0103e61:	8b 40 14             	mov    0x14(%eax),%eax
c0103e64:	ff d0                	call   *%eax
c0103e66:	89 45 f0             	mov    %eax,-0x10(%ebp)
    }
    local_intr_restore(intr_flag);
c0103e69:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0103e6c:	89 04 24             	mov    %eax,(%esp)
c0103e6f:	e8 bd fd ff ff       	call   c0103c31 <__intr_restore>
    return ret;
c0103e74:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c0103e77:	c9                   	leave  
c0103e78:	c3                   	ret    

c0103e79 <page_init>:

/* pmm_init - initialize the physical memory management */
static void
page_init(void) {
c0103e79:	f3 0f 1e fb          	endbr32 
c0103e7d:	55                   	push   %ebp
c0103e7e:	89 e5                	mov    %esp,%ebp
c0103e80:	57                   	push   %edi
c0103e81:	56                   	push   %esi
c0103e82:	53                   	push   %ebx
c0103e83:	81 ec 9c 00 00 00    	sub    $0x9c,%esp
    struct e820map *memmap = (struct e820map *)(0x8000 + KERNBASE);
c0103e89:	c7 45 c4 00 80 00 c0 	movl   $0xc0008000,-0x3c(%ebp)
    uint64_t maxpa = 0;
c0103e90:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
c0103e97:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)

    cprintf("e820map:\n");
c0103e9e:	c7 04 24 6f 9e 10 c0 	movl   $0xc0109e6f,(%esp)
c0103ea5:	e8 0b c4 ff ff       	call   c01002b5 <cprintf>
    int i;
    for (i = 0; i < memmap->nr_map; i ++) {
c0103eaa:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0103eb1:	e9 1a 01 00 00       	jmp    c0103fd0 <page_init+0x157>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c0103eb6:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0103eb9:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103ebc:	89 d0                	mov    %edx,%eax
c0103ebe:	c1 e0 02             	shl    $0x2,%eax
c0103ec1:	01 d0                	add    %edx,%eax
c0103ec3:	c1 e0 02             	shl    $0x2,%eax
c0103ec6:	01 c8                	add    %ecx,%eax
c0103ec8:	8b 50 08             	mov    0x8(%eax),%edx
c0103ecb:	8b 40 04             	mov    0x4(%eax),%eax
c0103ece:	89 45 a0             	mov    %eax,-0x60(%ebp)
c0103ed1:	89 55 a4             	mov    %edx,-0x5c(%ebp)
c0103ed4:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0103ed7:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103eda:	89 d0                	mov    %edx,%eax
c0103edc:	c1 e0 02             	shl    $0x2,%eax
c0103edf:	01 d0                	add    %edx,%eax
c0103ee1:	c1 e0 02             	shl    $0x2,%eax
c0103ee4:	01 c8                	add    %ecx,%eax
c0103ee6:	8b 48 0c             	mov    0xc(%eax),%ecx
c0103ee9:	8b 58 10             	mov    0x10(%eax),%ebx
c0103eec:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0103eef:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0103ef2:	01 c8                	add    %ecx,%eax
c0103ef4:	11 da                	adc    %ebx,%edx
c0103ef6:	89 45 98             	mov    %eax,-0x68(%ebp)
c0103ef9:	89 55 9c             	mov    %edx,-0x64(%ebp)
        cprintf("  memory: %08llx, [%08llx, %08llx], type = %d.\n",
c0103efc:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0103eff:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103f02:	89 d0                	mov    %edx,%eax
c0103f04:	c1 e0 02             	shl    $0x2,%eax
c0103f07:	01 d0                	add    %edx,%eax
c0103f09:	c1 e0 02             	shl    $0x2,%eax
c0103f0c:	01 c8                	add    %ecx,%eax
c0103f0e:	83 c0 14             	add    $0x14,%eax
c0103f11:	8b 00                	mov    (%eax),%eax
c0103f13:	89 45 84             	mov    %eax,-0x7c(%ebp)
c0103f16:	8b 45 98             	mov    -0x68(%ebp),%eax
c0103f19:	8b 55 9c             	mov    -0x64(%ebp),%edx
c0103f1c:	83 c0 ff             	add    $0xffffffff,%eax
c0103f1f:	83 d2 ff             	adc    $0xffffffff,%edx
c0103f22:	89 85 78 ff ff ff    	mov    %eax,-0x88(%ebp)
c0103f28:	89 95 7c ff ff ff    	mov    %edx,-0x84(%ebp)
c0103f2e:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0103f31:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103f34:	89 d0                	mov    %edx,%eax
c0103f36:	c1 e0 02             	shl    $0x2,%eax
c0103f39:	01 d0                	add    %edx,%eax
c0103f3b:	c1 e0 02             	shl    $0x2,%eax
c0103f3e:	01 c8                	add    %ecx,%eax
c0103f40:	8b 48 0c             	mov    0xc(%eax),%ecx
c0103f43:	8b 58 10             	mov    0x10(%eax),%ebx
c0103f46:	8b 55 84             	mov    -0x7c(%ebp),%edx
c0103f49:	89 54 24 1c          	mov    %edx,0x1c(%esp)
c0103f4d:	8b 85 78 ff ff ff    	mov    -0x88(%ebp),%eax
c0103f53:	8b 95 7c ff ff ff    	mov    -0x84(%ebp),%edx
c0103f59:	89 44 24 14          	mov    %eax,0x14(%esp)
c0103f5d:	89 54 24 18          	mov    %edx,0x18(%esp)
c0103f61:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0103f64:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0103f67:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0103f6b:	89 54 24 10          	mov    %edx,0x10(%esp)
c0103f6f:	89 4c 24 04          	mov    %ecx,0x4(%esp)
c0103f73:	89 5c 24 08          	mov    %ebx,0x8(%esp)
c0103f77:	c7 04 24 7c 9e 10 c0 	movl   $0xc0109e7c,(%esp)
c0103f7e:	e8 32 c3 ff ff       	call   c01002b5 <cprintf>
                memmap->map[i].size, begin, end - 1, memmap->map[i].type);
        if (memmap->map[i].type == E820_ARM) {
c0103f83:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0103f86:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0103f89:	89 d0                	mov    %edx,%eax
c0103f8b:	c1 e0 02             	shl    $0x2,%eax
c0103f8e:	01 d0                	add    %edx,%eax
c0103f90:	c1 e0 02             	shl    $0x2,%eax
c0103f93:	01 c8                	add    %ecx,%eax
c0103f95:	83 c0 14             	add    $0x14,%eax
c0103f98:	8b 00                	mov    (%eax),%eax
c0103f9a:	83 f8 01             	cmp    $0x1,%eax
c0103f9d:	75 2e                	jne    c0103fcd <page_init+0x154>
            if (maxpa < end && begin < KMEMSIZE) {
c0103f9f:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0103fa2:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0103fa5:	3b 45 98             	cmp    -0x68(%ebp),%eax
c0103fa8:	89 d0                	mov    %edx,%eax
c0103faa:	1b 45 9c             	sbb    -0x64(%ebp),%eax
c0103fad:	73 1e                	jae    c0103fcd <page_init+0x154>
c0103faf:	ba ff ff ff 37       	mov    $0x37ffffff,%edx
c0103fb4:	b8 00 00 00 00       	mov    $0x0,%eax
c0103fb9:	3b 55 a0             	cmp    -0x60(%ebp),%edx
c0103fbc:	1b 45 a4             	sbb    -0x5c(%ebp),%eax
c0103fbf:	72 0c                	jb     c0103fcd <page_init+0x154>
                maxpa = end;
c0103fc1:	8b 45 98             	mov    -0x68(%ebp),%eax
c0103fc4:	8b 55 9c             	mov    -0x64(%ebp),%edx
c0103fc7:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0103fca:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    for (i = 0; i < memmap->nr_map; i ++) {
c0103fcd:	ff 45 dc             	incl   -0x24(%ebp)
c0103fd0:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0103fd3:	8b 00                	mov    (%eax),%eax
c0103fd5:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c0103fd8:	0f 8c d8 fe ff ff    	jl     c0103eb6 <page_init+0x3d>
            }
        }
    }
    if (maxpa > KMEMSIZE) {
c0103fde:	ba 00 00 00 38       	mov    $0x38000000,%edx
c0103fe3:	b8 00 00 00 00       	mov    $0x0,%eax
c0103fe8:	3b 55 e0             	cmp    -0x20(%ebp),%edx
c0103feb:	1b 45 e4             	sbb    -0x1c(%ebp),%eax
c0103fee:	73 0e                	jae    c0103ffe <page_init+0x185>
        maxpa = KMEMSIZE;
c0103ff0:	c7 45 e0 00 00 00 38 	movl   $0x38000000,-0x20(%ebp)
c0103ff7:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
    }

    extern char end[];

    npage = maxpa / PGSIZE;
c0103ffe:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104001:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104004:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c0104008:	c1 ea 0c             	shr    $0xc,%edx
c010400b:	a3 80 6e 12 c0       	mov    %eax,0xc0126e80
    pages = (struct Page *)ROUNDUP((void *)end, PGSIZE);
c0104010:	c7 45 c0 00 10 00 00 	movl   $0x1000,-0x40(%ebp)
c0104017:	b8 d0 da 2a c0       	mov    $0xc02adad0,%eax
c010401c:	8d 50 ff             	lea    -0x1(%eax),%edx
c010401f:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0104022:	01 d0                	add    %edx,%eax
c0104024:	89 45 bc             	mov    %eax,-0x44(%ebp)
c0104027:	8b 45 bc             	mov    -0x44(%ebp),%eax
c010402a:	ba 00 00 00 00       	mov    $0x0,%edx
c010402f:	f7 75 c0             	divl   -0x40(%ebp)
c0104032:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0104035:	29 d0                	sub    %edx,%eax
c0104037:	a3 08 da 2a c0       	mov    %eax,0xc02ada08

    for (i = 0; i < npage; i ++) {
c010403c:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c0104043:	eb 2f                	jmp    c0104074 <page_init+0x1fb>
        SetPageReserved(pages + i);
c0104045:	8b 0d 08 da 2a c0    	mov    0xc02ada08,%ecx
c010404b:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010404e:	89 d0                	mov    %edx,%eax
c0104050:	c1 e0 03             	shl    $0x3,%eax
c0104053:	01 d0                	add    %edx,%eax
c0104055:	c1 e0 02             	shl    $0x2,%eax
c0104058:	01 c8                	add    %ecx,%eax
c010405a:	83 c0 04             	add    $0x4,%eax
c010405d:	c7 45 94 00 00 00 00 	movl   $0x0,-0x6c(%ebp)
c0104064:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0104067:	8b 45 90             	mov    -0x70(%ebp),%eax
c010406a:	8b 55 94             	mov    -0x6c(%ebp),%edx
c010406d:	0f ab 10             	bts    %edx,(%eax)
}
c0104070:	90                   	nop
    for (i = 0; i < npage; i ++) {
c0104071:	ff 45 dc             	incl   -0x24(%ebp)
c0104074:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104077:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c010407c:	39 c2                	cmp    %eax,%edx
c010407e:	72 c5                	jb     c0104045 <page_init+0x1cc>
    }

    uintptr_t freemem = PADDR((uintptr_t)pages + sizeof(struct Page) * npage);
c0104080:	8b 15 80 6e 12 c0    	mov    0xc0126e80,%edx
c0104086:	89 d0                	mov    %edx,%eax
c0104088:	c1 e0 03             	shl    $0x3,%eax
c010408b:	01 d0                	add    %edx,%eax
c010408d:	c1 e0 02             	shl    $0x2,%eax
c0104090:	89 c2                	mov    %eax,%edx
c0104092:	a1 08 da 2a c0       	mov    0xc02ada08,%eax
c0104097:	01 d0                	add    %edx,%eax
c0104099:	89 45 b8             	mov    %eax,-0x48(%ebp)
c010409c:	81 7d b8 ff ff ff bf 	cmpl   $0xbfffffff,-0x48(%ebp)
c01040a3:	77 23                	ja     c01040c8 <page_init+0x24f>
c01040a5:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01040a8:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01040ac:	c7 44 24 08 ac 9e 10 	movl   $0xc0109eac,0x8(%esp)
c01040b3:	c0 
c01040b4:	c7 44 24 04 dd 00 00 	movl   $0xdd,0x4(%esp)
c01040bb:	00 
c01040bc:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01040c3:	e8 59 c3 ff ff       	call   c0100421 <__panic>
c01040c8:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01040cb:	05 00 00 00 40       	add    $0x40000000,%eax
c01040d0:	89 45 b4             	mov    %eax,-0x4c(%ebp)

    for (i = 0; i < memmap->nr_map; i ++) {
c01040d3:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c01040da:	e9 63 01 00 00       	jmp    c0104242 <page_init+0x3c9>
        uint64_t begin = memmap->map[i].addr, end = begin + memmap->map[i].size;
c01040df:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c01040e2:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01040e5:	89 d0                	mov    %edx,%eax
c01040e7:	c1 e0 02             	shl    $0x2,%eax
c01040ea:	01 d0                	add    %edx,%eax
c01040ec:	c1 e0 02             	shl    $0x2,%eax
c01040ef:	01 c8                	add    %ecx,%eax
c01040f1:	8b 50 08             	mov    0x8(%eax),%edx
c01040f4:	8b 40 04             	mov    0x4(%eax),%eax
c01040f7:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01040fa:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c01040fd:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104100:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0104103:	89 d0                	mov    %edx,%eax
c0104105:	c1 e0 02             	shl    $0x2,%eax
c0104108:	01 d0                	add    %edx,%eax
c010410a:	c1 e0 02             	shl    $0x2,%eax
c010410d:	01 c8                	add    %ecx,%eax
c010410f:	8b 48 0c             	mov    0xc(%eax),%ecx
c0104112:	8b 58 10             	mov    0x10(%eax),%ebx
c0104115:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104118:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010411b:	01 c8                	add    %ecx,%eax
c010411d:	11 da                	adc    %ebx,%edx
c010411f:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0104122:	89 55 cc             	mov    %edx,-0x34(%ebp)
        if (memmap->map[i].type == E820_ARM) {
c0104125:	8b 4d c4             	mov    -0x3c(%ebp),%ecx
c0104128:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010412b:	89 d0                	mov    %edx,%eax
c010412d:	c1 e0 02             	shl    $0x2,%eax
c0104130:	01 d0                	add    %edx,%eax
c0104132:	c1 e0 02             	shl    $0x2,%eax
c0104135:	01 c8                	add    %ecx,%eax
c0104137:	83 c0 14             	add    $0x14,%eax
c010413a:	8b 00                	mov    (%eax),%eax
c010413c:	83 f8 01             	cmp    $0x1,%eax
c010413f:	0f 85 fa 00 00 00    	jne    c010423f <page_init+0x3c6>
            if (begin < freemem) {
c0104145:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0104148:	ba 00 00 00 00       	mov    $0x0,%edx
c010414d:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c0104150:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c0104153:	19 d1                	sbb    %edx,%ecx
c0104155:	73 0d                	jae    c0104164 <page_init+0x2eb>
                begin = freemem;
c0104157:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c010415a:	89 45 d0             	mov    %eax,-0x30(%ebp)
c010415d:	c7 45 d4 00 00 00 00 	movl   $0x0,-0x2c(%ebp)
            }
            if (end > KMEMSIZE) {
c0104164:	ba 00 00 00 38       	mov    $0x38000000,%edx
c0104169:	b8 00 00 00 00       	mov    $0x0,%eax
c010416e:	3b 55 c8             	cmp    -0x38(%ebp),%edx
c0104171:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c0104174:	73 0e                	jae    c0104184 <page_init+0x30b>
                end = KMEMSIZE;
c0104176:	c7 45 c8 00 00 00 38 	movl   $0x38000000,-0x38(%ebp)
c010417d:	c7 45 cc 00 00 00 00 	movl   $0x0,-0x34(%ebp)
            }
            if (begin < end) {
c0104184:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104187:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c010418a:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c010418d:	89 d0                	mov    %edx,%eax
c010418f:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c0104192:	0f 83 a7 00 00 00    	jae    c010423f <page_init+0x3c6>
                begin = ROUNDUP(begin, PGSIZE);
c0104198:	c7 45 b0 00 10 00 00 	movl   $0x1000,-0x50(%ebp)
c010419f:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01041a2:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01041a5:	01 d0                	add    %edx,%eax
c01041a7:	48                   	dec    %eax
c01041a8:	89 45 ac             	mov    %eax,-0x54(%ebp)
c01041ab:	8b 45 ac             	mov    -0x54(%ebp),%eax
c01041ae:	ba 00 00 00 00       	mov    $0x0,%edx
c01041b3:	f7 75 b0             	divl   -0x50(%ebp)
c01041b6:	8b 45 ac             	mov    -0x54(%ebp),%eax
c01041b9:	29 d0                	sub    %edx,%eax
c01041bb:	ba 00 00 00 00       	mov    $0x0,%edx
c01041c0:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01041c3:	89 55 d4             	mov    %edx,-0x2c(%ebp)
                end = ROUNDDOWN(end, PGSIZE);
c01041c6:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01041c9:	89 45 a8             	mov    %eax,-0x58(%ebp)
c01041cc:	8b 45 a8             	mov    -0x58(%ebp),%eax
c01041cf:	ba 00 00 00 00       	mov    $0x0,%edx
c01041d4:	89 c3                	mov    %eax,%ebx
c01041d6:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
c01041dc:	89 de                	mov    %ebx,%esi
c01041de:	89 d0                	mov    %edx,%eax
c01041e0:	83 e0 00             	and    $0x0,%eax
c01041e3:	89 c7                	mov    %eax,%edi
c01041e5:	89 75 c8             	mov    %esi,-0x38(%ebp)
c01041e8:	89 7d cc             	mov    %edi,-0x34(%ebp)
                if (begin < end) {
c01041eb:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01041ee:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01041f1:	3b 45 c8             	cmp    -0x38(%ebp),%eax
c01041f4:	89 d0                	mov    %edx,%eax
c01041f6:	1b 45 cc             	sbb    -0x34(%ebp),%eax
c01041f9:	73 44                	jae    c010423f <page_init+0x3c6>
                    first_ppn = page2ppn(pa2page(begin));
c01041fb:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01041fe:	89 04 24             	mov    %eax,(%esp)
c0104201:	e8 c2 f8 ff ff       	call   c0103ac8 <pa2page>
c0104206:	89 04 24             	mov    %eax,(%esp)
c0104209:	e8 8a f8 ff ff       	call   c0103a98 <page2ppn>
c010420e:	a3 84 6e 12 c0       	mov    %eax,0xc0126e84
                    init_memmap(pa2page(begin), (end - begin) / PGSIZE);
c0104213:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0104216:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0104219:	2b 45 d0             	sub    -0x30(%ebp),%eax
c010421c:	1b 55 d4             	sbb    -0x2c(%ebp),%edx
c010421f:	0f ac d0 0c          	shrd   $0xc,%edx,%eax
c0104223:	c1 ea 0c             	shr    $0xc,%edx
c0104226:	89 c3                	mov    %eax,%ebx
c0104228:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010422b:	89 04 24             	mov    %eax,(%esp)
c010422e:	e8 95 f8 ff ff       	call   c0103ac8 <pa2page>
c0104233:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c0104237:	89 04 24             	mov    %eax,(%esp)
c010423a:	e8 74 fb ff ff       	call   c0103db3 <init_memmap>
    for (i = 0; i < memmap->nr_map; i ++) {
c010423f:	ff 45 dc             	incl   -0x24(%ebp)
c0104242:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0104245:	8b 00                	mov    (%eax),%eax
c0104247:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c010424a:	0f 8c 8f fe ff ff    	jl     c01040df <page_init+0x266>
                }
            }
        }
    }
}
c0104250:	90                   	nop
c0104251:	90                   	nop
c0104252:	81 c4 9c 00 00 00    	add    $0x9c,%esp
c0104258:	5b                   	pop    %ebx
c0104259:	5e                   	pop    %esi
c010425a:	5f                   	pop    %edi
c010425b:	5d                   	pop    %ebp
c010425c:	c3                   	ret    

c010425d <boot_map_segment>:
//  la:   linear address of this memory need to map (after x86 segment map)
//  size: memory size
//  pa:   physical address of this memory
//  perm: permission of this memory  
static void
boot_map_segment(pde_t *pgdir, uintptr_t la, size_t size, uintptr_t pa, uint32_t perm) {
c010425d:	f3 0f 1e fb          	endbr32 
c0104261:	55                   	push   %ebp
c0104262:	89 e5                	mov    %esp,%ebp
c0104264:	83 ec 38             	sub    $0x38,%esp
    assert(PGOFF(la) == PGOFF(pa));
c0104267:	8b 45 0c             	mov    0xc(%ebp),%eax
c010426a:	33 45 14             	xor    0x14(%ebp),%eax
c010426d:	25 ff 0f 00 00       	and    $0xfff,%eax
c0104272:	85 c0                	test   %eax,%eax
c0104274:	74 24                	je     c010429a <boot_map_segment+0x3d>
c0104276:	c7 44 24 0c de 9e 10 	movl   $0xc0109ede,0xc(%esp)
c010427d:	c0 
c010427e:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104285:	c0 
c0104286:	c7 44 24 04 fc 00 00 	movl   $0xfc,0x4(%esp)
c010428d:	00 
c010428e:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104295:	e8 87 c1 ff ff       	call   c0100421 <__panic>
    size_t n = ROUNDUP(size + PGOFF(la), PGSIZE) / PGSIZE;
c010429a:	c7 45 f0 00 10 00 00 	movl   $0x1000,-0x10(%ebp)
c01042a1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01042a4:	25 ff 0f 00 00       	and    $0xfff,%eax
c01042a9:	89 c2                	mov    %eax,%edx
c01042ab:	8b 45 10             	mov    0x10(%ebp),%eax
c01042ae:	01 c2                	add    %eax,%edx
c01042b0:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01042b3:	01 d0                	add    %edx,%eax
c01042b5:	48                   	dec    %eax
c01042b6:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01042b9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01042bc:	ba 00 00 00 00       	mov    $0x0,%edx
c01042c1:	f7 75 f0             	divl   -0x10(%ebp)
c01042c4:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01042c7:	29 d0                	sub    %edx,%eax
c01042c9:	c1 e8 0c             	shr    $0xc,%eax
c01042cc:	89 45 f4             	mov    %eax,-0xc(%ebp)
    la = ROUNDDOWN(la, PGSIZE);
c01042cf:	8b 45 0c             	mov    0xc(%ebp),%eax
c01042d2:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01042d5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01042d8:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01042dd:	89 45 0c             	mov    %eax,0xc(%ebp)
    pa = ROUNDDOWN(pa, PGSIZE);
c01042e0:	8b 45 14             	mov    0x14(%ebp),%eax
c01042e3:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01042e6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01042e9:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01042ee:	89 45 14             	mov    %eax,0x14(%ebp)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c01042f1:	eb 68                	jmp    c010435b <boot_map_segment+0xfe>
        pte_t *ptep = get_pte(pgdir, la, 1);
c01042f3:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c01042fa:	00 
c01042fb:	8b 45 0c             	mov    0xc(%ebp),%eax
c01042fe:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104302:	8b 45 08             	mov    0x8(%ebp),%eax
c0104305:	89 04 24             	mov    %eax,(%esp)
c0104308:	e8 91 01 00 00       	call   c010449e <get_pte>
c010430d:	89 45 e0             	mov    %eax,-0x20(%ebp)
        assert(ptep != NULL);
c0104310:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c0104314:	75 24                	jne    c010433a <boot_map_segment+0xdd>
c0104316:	c7 44 24 0c 0a 9f 10 	movl   $0xc0109f0a,0xc(%esp)
c010431d:	c0 
c010431e:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104325:	c0 
c0104326:	c7 44 24 04 02 01 00 	movl   $0x102,0x4(%esp)
c010432d:	00 
c010432e:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104335:	e8 e7 c0 ff ff       	call   c0100421 <__panic>
        *ptep = pa | PTE_P | perm;
c010433a:	8b 45 14             	mov    0x14(%ebp),%eax
c010433d:	0b 45 18             	or     0x18(%ebp),%eax
c0104340:	83 c8 01             	or     $0x1,%eax
c0104343:	89 c2                	mov    %eax,%edx
c0104345:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0104348:	89 10                	mov    %edx,(%eax)
    for (; n > 0; n --, la += PGSIZE, pa += PGSIZE) {
c010434a:	ff 4d f4             	decl   -0xc(%ebp)
c010434d:	81 45 0c 00 10 00 00 	addl   $0x1000,0xc(%ebp)
c0104354:	81 45 14 00 10 00 00 	addl   $0x1000,0x14(%ebp)
c010435b:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010435f:	75 92                	jne    c01042f3 <boot_map_segment+0x96>
    }
}
c0104361:	90                   	nop
c0104362:	90                   	nop
c0104363:	c9                   	leave  
c0104364:	c3                   	ret    

c0104365 <boot_alloc_page>:

//boot_alloc_page - allocate one page using pmm->alloc_pages(1) 
// return value: the kernel virtual address of this allocated page
//note: this function is used to get the memory for PDT(Page Directory Table)&PT(Page Table)
static void *
boot_alloc_page(void) {
c0104365:	f3 0f 1e fb          	endbr32 
c0104369:	55                   	push   %ebp
c010436a:	89 e5                	mov    %esp,%ebp
c010436c:	83 ec 28             	sub    $0x28,%esp
    struct Page *p = alloc_page();
c010436f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104376:	e8 5c fa ff ff       	call   c0103dd7 <alloc_pages>
c010437b:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (p == NULL) {
c010437e:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104382:	75 1c                	jne    c01043a0 <boot_alloc_page+0x3b>
        panic("boot_alloc_page failed.\n");
c0104384:	c7 44 24 08 17 9f 10 	movl   $0xc0109f17,0x8(%esp)
c010438b:	c0 
c010438c:	c7 44 24 04 0e 01 00 	movl   $0x10e,0x4(%esp)
c0104393:	00 
c0104394:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c010439b:	e8 81 c0 ff ff       	call   c0100421 <__panic>
    }
    return page2kva(p);
c01043a0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01043a3:	89 04 24             	mov    %eax,(%esp)
c01043a6:	e8 6c f7 ff ff       	call   c0103b17 <page2kva>
}
c01043ab:	c9                   	leave  
c01043ac:	c3                   	ret    

c01043ad <pmm_init>:

//pmm_init - setup a pmm to manage physical memory, build PDT&PT to setup paging mechanism 
//         - check the correctness of pmm & paging mechanism, print PDT&PT
void
pmm_init(void) {
c01043ad:	f3 0f 1e fb          	endbr32 
c01043b1:	55                   	push   %ebp
c01043b2:	89 e5                	mov    %esp,%ebp
c01043b4:	83 ec 38             	sub    $0x38,%esp
    // We've already enabled paging
    boot_cr3 = PADDR(boot_pgdir);
c01043b7:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c01043bc:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01043bf:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c01043c6:	77 23                	ja     c01043eb <pmm_init+0x3e>
c01043c8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01043cb:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01043cf:	c7 44 24 08 ac 9e 10 	movl   $0xc0109eac,0x8(%esp)
c01043d6:	c0 
c01043d7:	c7 44 24 04 18 01 00 	movl   $0x118,0x4(%esp)
c01043de:	00 
c01043df:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01043e6:	e8 36 c0 ff ff       	call   c0100421 <__panic>
c01043eb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01043ee:	05 00 00 00 40       	add    $0x40000000,%eax
c01043f3:	a3 04 da 2a c0       	mov    %eax,0xc02ada04
    //We need to alloc/free the physical memory (granularity is 4KB or other size). 
    //So a framework of physical memory manager (struct pmm_manager)is defined in pmm.h
    //First we should init a physical memory manager(pmm) based on the framework.
    //Then pmm can alloc/free the physical memory. 
    //Now the first_fit/best_fit/worst_fit/buddy_system pmm are available.
    init_pmm_manager();
c01043f8:	e8 7e f9 ff ff       	call   c0103d7b <init_pmm_manager>

    // detect physical memory space, reserve already used memory,
    // then use pmm->init_memmap to create free page list
    page_init();
c01043fd:	e8 77 fa ff ff       	call   c0103e79 <page_init>

    //use pmm->check to verify the correctness of the alloc/free function in a pmm
    check_alloc_page();
c0104402:	e8 8e 04 00 00       	call   c0104895 <check_alloc_page>

    check_pgdir();
c0104407:	e8 ac 04 00 00       	call   c01048b8 <check_pgdir>

    static_assert(KERNBASE % PTSIZE == 0 && KERNTOP % PTSIZE == 0);

    // recursively insert boot_pgdir in itself
    // to form a virtual page table at virtual address VPT
    boot_pgdir[PDX(VPT)] = PADDR(boot_pgdir) | PTE_P | PTE_W;
c010440c:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104411:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104414:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c010441b:	77 23                	ja     c0104440 <pmm_init+0x93>
c010441d:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104420:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104424:	c7 44 24 08 ac 9e 10 	movl   $0xc0109eac,0x8(%esp)
c010442b:	c0 
c010442c:	c7 44 24 04 2e 01 00 	movl   $0x12e,0x4(%esp)
c0104433:	00 
c0104434:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c010443b:	e8 e1 bf ff ff       	call   c0100421 <__panic>
c0104440:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104443:	8d 90 00 00 00 40    	lea    0x40000000(%eax),%edx
c0104449:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c010444e:	05 ac 0f 00 00       	add    $0xfac,%eax
c0104453:	83 ca 03             	or     $0x3,%edx
c0104456:	89 10                	mov    %edx,(%eax)

    // map all physical memory to linear memory with base linear addr KERNBASE
    // linear_addr KERNBASE ~ KERNBASE + KMEMSIZE = phy_addr 0 ~ KMEMSIZE
    boot_map_segment(boot_pgdir, KERNBASE, KMEMSIZE, 0, PTE_W);
c0104458:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c010445d:	c7 44 24 10 02 00 00 	movl   $0x2,0x10(%esp)
c0104464:	00 
c0104465:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c010446c:	00 
c010446d:	c7 44 24 08 00 00 00 	movl   $0x38000000,0x8(%esp)
c0104474:	38 
c0104475:	c7 44 24 04 00 00 00 	movl   $0xc0000000,0x4(%esp)
c010447c:	c0 
c010447d:	89 04 24             	mov    %eax,(%esp)
c0104480:	e8 d8 fd ff ff       	call   c010425d <boot_map_segment>

    // Since we are using bootloader's GDT,
    // we should reload gdt (second time, the last time) to get user segments and the TSS
    // map virtual_addr 0 ~ 4G = linear_addr 0 ~ 4G
    // then set kernel stack (ss:esp) in TSS, setup TSS in gdt, load TSS
    gdt_init();
c0104485:	e8 03 f8 ff ff       	call   c0103c8d <gdt_init>

    //now the basic virtual memory map(see memalyout.h) is established.
    //check the correctness of the basic virtual memory map.
    check_boot_pgdir();
c010448a:	e8 c9 0a 00 00       	call   c0104f58 <check_boot_pgdir>

    print_pgdir();
c010448f:	e8 4e 0f 00 00       	call   c01053e2 <print_pgdir>
    check();
c0104494:	a1 44 3a 12 c0       	mov    0xc0123a44,%eax
c0104499:	ff d0                	call   *%eax

}
c010449b:	90                   	nop
c010449c:	c9                   	leave  
c010449d:	c3                   	ret    

c010449e <get_pte>:
//  pgdir:  the kernel virtual base address of PDT
//  la:     the linear address need to map
//  create: a logical value to decide if alloc a page for PT
// return vaule: the kernel virtual address of this pte
pte_t *
get_pte(pde_t *pgdir, uintptr_t la, bool create) {
c010449e:	f3 0f 1e fb          	endbr32 
c01044a2:	55                   	push   %ebp
c01044a3:	89 e5                	mov    %esp,%ebp
c01044a5:	83 ec 58             	sub    $0x58,%esp
                          // (7) set page directory entry's permission
    }
    return NULL;          // (8) return page table entry
#endif
    //得到对应的pde下标
    uint32_t pde_idx = PDX(la);
c01044a8:	8b 45 0c             	mov    0xc(%ebp),%eax
c01044ab:	c1 e8 16             	shr    $0x16,%eax
c01044ae:	89 45 f0             	mov    %eax,-0x10(%ebp)
    //找到对应pte
    uint32_t *pde_tar = (uint32_t)pgdir + (pde_idx<<2);
c01044b1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01044b4:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c01044bb:	8b 45 08             	mov    0x8(%ebp),%eax
c01044be:	01 d0                	add    %edx,%eax
c01044c0:	89 45 ec             	mov    %eax,-0x14(%ebp)
    uint32_t pte_idx = NULL;
c01044c3:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
    uint32_t *pte_tar = NULL;
c01044ca:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    uint32_t exi_page;

    //观察是否存在表项
    if (!(*pde_tar & PTE_P))
c01044d1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01044d4:	8b 00                	mov    (%eax),%eax
c01044d6:	83 e0 01             	and    $0x1,%eax
c01044d9:	85 c0                	test   %eax,%eax
c01044db:	0f 85 1b 01 00 00    	jne    c01045fc <get_pte+0x15e>
    {
        //如果需要创建
        if (create)
c01044e1:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c01044e5:	0f 84 0a 01 00 00    	je     c01045f5 <get_pte+0x157>
        {
            //申请一个二级页表的空间，并且设置引用数
            struct Page *new_page = alloc_page();
c01044eb:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01044f2:	e8 e0 f8 ff ff       	call   c0103dd7 <alloc_pages>
c01044f7:	89 45 d8             	mov    %eax,-0x28(%ebp)
            if(new_page==NULL)
c01044fa:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c01044fe:	75 0a                	jne    c010450a <get_pte+0x6c>
            	return NULL;
c0104500:	b8 00 00 00 00       	mov    $0x0,%eax
c0104505:	e9 63 01 00 00       	jmp    c010466d <get_pte+0x1cf>
            set_page_ref(new_page, 1);
c010450a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0104511:	00 
c0104512:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104515:	89 04 24             	mov    %eax,(%esp)
c0104518:	e8 ae f6 ff ff       	call   c0103bcb <set_page_ref>
            //获得该二级页表所对应的物理地址，初始化二级页表后，将其填入pde
            uintptr_t pt_addr = page2pa(new_page);
c010451d:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0104520:	89 04 24             	mov    %eax,(%esp)
c0104523:	e8 8a f5 ff ff       	call   c0103ab2 <page2pa>
c0104528:	89 45 d4             	mov    %eax,-0x2c(%ebp)
            memset(KADDR(pt_addr),0x0,PGSIZE);
c010452b:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010452e:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0104531:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104534:	c1 e8 0c             	shr    $0xc,%eax
c0104537:	89 45 cc             	mov    %eax,-0x34(%ebp)
c010453a:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c010453f:	39 45 cc             	cmp    %eax,-0x34(%ebp)
c0104542:	72 23                	jb     c0104567 <get_pte+0xc9>
c0104544:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0104547:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010454b:	c7 44 24 08 08 9e 10 	movl   $0xc0109e08,0x8(%esp)
c0104552:	c0 
c0104553:	c7 44 24 04 82 01 00 	movl   $0x182,0x4(%esp)
c010455a:	00 
c010455b:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104562:	e8 ba be ff ff       	call   c0100421 <__panic>
c0104567:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010456a:	2d 00 00 00 40       	sub    $0x40000000,%eax
c010456f:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104576:	00 
c0104577:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c010457e:	00 
c010457f:	89 04 24             	mov    %eax,(%esp)
c0104582:	e8 57 47 00 00       	call   c0108cde <memset>
            *pde_tar = pt_addr| PTE_P | PTE_W | PTE_U;
c0104587:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010458a:	83 c8 07             	or     $0x7,%eax
c010458d:	89 c2                	mov    %eax,%edx
c010458f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104592:	89 10                	mov    %edx,(%eax)
            pte_idx = PTX(la);
c0104594:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104597:	c1 e8 0c             	shr    $0xc,%eax
c010459a:	25 ff 03 00 00       	and    $0x3ff,%eax
c010459f:	89 45 e8             	mov    %eax,-0x18(%ebp)
            pte_tar = KADDR(pt_addr) + (pte_idx << 2);
c01045a2:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01045a5:	89 45 c8             	mov    %eax,-0x38(%ebp)
c01045a8:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01045ab:	c1 e8 0c             	shr    $0xc,%eax
c01045ae:	89 45 c4             	mov    %eax,-0x3c(%ebp)
c01045b1:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c01045b6:	39 45 c4             	cmp    %eax,-0x3c(%ebp)
c01045b9:	72 23                	jb     c01045de <get_pte+0x140>
c01045bb:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01045be:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01045c2:	c7 44 24 08 08 9e 10 	movl   $0xc0109e08,0x8(%esp)
c01045c9:	c0 
c01045ca:	c7 44 24 04 85 01 00 	movl   $0x185,0x4(%esp)
c01045d1:	00 
c01045d2:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01045d9:	e8 43 be ff ff       	call   c0100421 <__panic>
c01045de:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01045e1:	2d 00 00 00 40       	sub    $0x40000000,%eax
c01045e6:	89 c2                	mov    %eax,%edx
c01045e8:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01045eb:	c1 e0 02             	shl    $0x2,%eax
c01045ee:	01 d0                	add    %edx,%eax
c01045f0:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01045f3:	eb 75                	jmp    c010466a <get_pte+0x1cc>
        }
        else
        {
            return NULL;
c01045f5:	b8 00 00 00 00       	mov    $0x0,%eax
c01045fa:	eb 71                	jmp    c010466d <get_pte+0x1cf>
        }
    }
    else
    {
        //获得二级页表的线性地址
        exi_page = (uint32_t)KADDR(*pde_tar) & 0xfffff000;
c01045fc:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01045ff:	8b 00                	mov    (%eax),%eax
c0104601:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0104604:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104607:	c1 e8 0c             	shr    $0xc,%eax
c010460a:	89 45 e0             	mov    %eax,-0x20(%ebp)
c010460d:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c0104612:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0104615:	72 23                	jb     c010463a <get_pte+0x19c>
c0104617:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010461a:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010461e:	c7 44 24 08 08 9e 10 	movl   $0xc0109e08,0x8(%esp)
c0104625:	c0 
c0104626:	c7 44 24 04 8f 01 00 	movl   $0x18f,0x4(%esp)
c010462d:	00 
c010462e:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104635:	e8 e7 bd ff ff       	call   c0100421 <__panic>
c010463a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010463d:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104642:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104647:	89 45 dc             	mov    %eax,-0x24(%ebp)
        //计算对于pte的偏移
        pte_idx = PTX(la);
c010464a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010464d:	c1 e8 0c             	shr    $0xc,%eax
c0104650:	25 ff 03 00 00       	and    $0x3ff,%eax
c0104655:	89 45 e8             	mov    %eax,-0x18(%ebp)
        pte_tar = exi_page + (pte_idx << 2);
c0104658:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010465b:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0104662:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0104665:	01 d0                	add    %edx,%eax
c0104667:	89 45 f4             	mov    %eax,-0xc(%ebp)
    }
    return (pte_t*)pte_tar;
c010466a:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c010466d:	c9                   	leave  
c010466e:	c3                   	ret    

c010466f <get_page>:

//get_page - get related Page struct for linear address la using PDT pgdir
struct Page *
get_page(pde_t *pgdir, uintptr_t la, pte_t **ptep_store) {
c010466f:	f3 0f 1e fb          	endbr32 
c0104673:	55                   	push   %ebp
c0104674:	89 e5                	mov    %esp,%ebp
c0104676:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
c0104679:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104680:	00 
c0104681:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104684:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104688:	8b 45 08             	mov    0x8(%ebp),%eax
c010468b:	89 04 24             	mov    %eax,(%esp)
c010468e:	e8 0b fe ff ff       	call   c010449e <get_pte>
c0104693:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep_store != NULL) {
c0104696:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c010469a:	74 08                	je     c01046a4 <get_page+0x35>
        *ptep_store = ptep;
c010469c:	8b 45 10             	mov    0x10(%ebp),%eax
c010469f:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01046a2:	89 10                	mov    %edx,(%eax)
    }
    if (ptep != NULL && *ptep & PTE_P) {
c01046a4:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01046a8:	74 1b                	je     c01046c5 <get_page+0x56>
c01046aa:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01046ad:	8b 00                	mov    (%eax),%eax
c01046af:	83 e0 01             	and    $0x1,%eax
c01046b2:	85 c0                	test   %eax,%eax
c01046b4:	74 0f                	je     c01046c5 <get_page+0x56>
        return pte2page(*ptep);
c01046b6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01046b9:	8b 00                	mov    (%eax),%eax
c01046bb:	89 04 24             	mov    %eax,(%esp)
c01046be:	e8 a8 f4 ff ff       	call   c0103b6b <pte2page>
c01046c3:	eb 05                	jmp    c01046ca <get_page+0x5b>
    }
    return NULL;
c01046c5:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01046ca:	c9                   	leave  
c01046cb:	c3                   	ret    

c01046cc <page_remove_pte>:

//page_remove_pte - free an Page sturct which is related linear address la
//                - and clean(invalidate) pte which is related linear address la
//note: PT is changed, so the TLB need to be invalidate 
static inline void
page_remove_pte(pde_t *pgdir, uintptr_t la, pte_t *ptep) {
c01046cc:	55                   	push   %ebp
c01046cd:	89 e5                	mov    %esp,%ebp
c01046cf:	83 ec 28             	sub    $0x28,%esp
                                  //(4) and free this page when page reference reachs 0
                                  //(5) clear second page table entry
                                  //(6) flush tlb
    }
#endif
    if (*ptep & PTE_P) {
c01046d2:	8b 45 10             	mov    0x10(%ebp),%eax
c01046d5:	8b 00                	mov    (%eax),%eax
c01046d7:	83 e0 01             	and    $0x1,%eax
c01046da:	85 c0                	test   %eax,%eax
c01046dc:	74 4d                	je     c010472b <page_remove_pte+0x5f>
        struct Page *page = pte2page(*ptep);
c01046de:	8b 45 10             	mov    0x10(%ebp),%eax
c01046e1:	8b 00                	mov    (%eax),%eax
c01046e3:	89 04 24             	mov    %eax,(%esp)
c01046e6:	e8 80 f4 ff ff       	call   c0103b6b <pte2page>
c01046eb:	89 45 f4             	mov    %eax,-0xc(%ebp)
        if (page_ref_dec(page) == 0) {
c01046ee:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01046f1:	89 04 24             	mov    %eax,(%esp)
c01046f4:	e8 f7 f4 ff ff       	call   c0103bf0 <page_ref_dec>
c01046f9:	85 c0                	test   %eax,%eax
c01046fb:	75 13                	jne    c0104710 <page_remove_pte+0x44>
            free_page(page);
c01046fd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0104704:	00 
c0104705:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104708:	89 04 24             	mov    %eax,(%esp)
c010470b:	e8 03 f7 ff ff       	call   c0103e13 <free_pages>
        }
        *ptep = 0;
c0104710:	8b 45 10             	mov    0x10(%ebp),%eax
c0104713:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
        tlb_invalidate(pgdir, la);
c0104719:	8b 45 0c             	mov    0xc(%ebp),%eax
c010471c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104720:	8b 45 08             	mov    0x8(%ebp),%eax
c0104723:	89 04 24             	mov    %eax,(%esp)
c0104726:	e8 09 01 00 00       	call   c0104834 <tlb_invalidate>
    }
}
c010472b:	90                   	nop
c010472c:	c9                   	leave  
c010472d:	c3                   	ret    

c010472e <page_remove>:

//page_remove - free an Page which is related linear address la and has an validated pte
void
page_remove(pde_t *pgdir, uintptr_t la) {
c010472e:	f3 0f 1e fb          	endbr32 
c0104732:	55                   	push   %ebp
c0104733:	89 e5                	mov    %esp,%ebp
c0104735:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 0);
c0104738:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c010473f:	00 
c0104740:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104743:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104747:	8b 45 08             	mov    0x8(%ebp),%eax
c010474a:	89 04 24             	mov    %eax,(%esp)
c010474d:	e8 4c fd ff ff       	call   c010449e <get_pte>
c0104752:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep != NULL) {
c0104755:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0104759:	74 19                	je     c0104774 <page_remove+0x46>
        page_remove_pte(pgdir, la, ptep);
c010475b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010475e:	89 44 24 08          	mov    %eax,0x8(%esp)
c0104762:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104765:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104769:	8b 45 08             	mov    0x8(%ebp),%eax
c010476c:	89 04 24             	mov    %eax,(%esp)
c010476f:	e8 58 ff ff ff       	call   c01046cc <page_remove_pte>
    }
}
c0104774:	90                   	nop
c0104775:	c9                   	leave  
c0104776:	c3                   	ret    

c0104777 <page_insert>:
//  la:    the linear address need to map
//  perm:  the permission of this Page which is setted in related pte
// return value: always 0
//note: PT is changed, so the TLB need to be invalidate 
int
page_insert(pde_t *pgdir, struct Page *page, uintptr_t la, uint32_t perm) {
c0104777:	f3 0f 1e fb          	endbr32 
c010477b:	55                   	push   %ebp
c010477c:	89 e5                	mov    %esp,%ebp
c010477e:	83 ec 28             	sub    $0x28,%esp
    pte_t *ptep = get_pte(pgdir, la, 1);
c0104781:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
c0104788:	00 
c0104789:	8b 45 10             	mov    0x10(%ebp),%eax
c010478c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104790:	8b 45 08             	mov    0x8(%ebp),%eax
c0104793:	89 04 24             	mov    %eax,(%esp)
c0104796:	e8 03 fd ff ff       	call   c010449e <get_pte>
c010479b:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (ptep == NULL) {
c010479e:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01047a2:	75 0a                	jne    c01047ae <page_insert+0x37>
        return -E_NO_MEM;
c01047a4:	b8 fc ff ff ff       	mov    $0xfffffffc,%eax
c01047a9:	e9 84 00 00 00       	jmp    c0104832 <page_insert+0xbb>
    }
    page_ref_inc(page);
c01047ae:	8b 45 0c             	mov    0xc(%ebp),%eax
c01047b1:	89 04 24             	mov    %eax,(%esp)
c01047b4:	e8 20 f4 ff ff       	call   c0103bd9 <page_ref_inc>
    if (*ptep & PTE_P) {
c01047b9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047bc:	8b 00                	mov    (%eax),%eax
c01047be:	83 e0 01             	and    $0x1,%eax
c01047c1:	85 c0                	test   %eax,%eax
c01047c3:	74 3e                	je     c0104803 <page_insert+0x8c>
        struct Page *p = pte2page(*ptep);
c01047c5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047c8:	8b 00                	mov    (%eax),%eax
c01047ca:	89 04 24             	mov    %eax,(%esp)
c01047cd:	e8 99 f3 ff ff       	call   c0103b6b <pte2page>
c01047d2:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (p == page) {
c01047d5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01047d8:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01047db:	75 0d                	jne    c01047ea <page_insert+0x73>
            page_ref_dec(page);
c01047dd:	8b 45 0c             	mov    0xc(%ebp),%eax
c01047e0:	89 04 24             	mov    %eax,(%esp)
c01047e3:	e8 08 f4 ff ff       	call   c0103bf0 <page_ref_dec>
c01047e8:	eb 19                	jmp    c0104803 <page_insert+0x8c>
        }
        else {
            page_remove_pte(pgdir, la, ptep);
c01047ea:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01047ed:	89 44 24 08          	mov    %eax,0x8(%esp)
c01047f1:	8b 45 10             	mov    0x10(%ebp),%eax
c01047f4:	89 44 24 04          	mov    %eax,0x4(%esp)
c01047f8:	8b 45 08             	mov    0x8(%ebp),%eax
c01047fb:	89 04 24             	mov    %eax,(%esp)
c01047fe:	e8 c9 fe ff ff       	call   c01046cc <page_remove_pte>
        }
    }
    *ptep = page2pa(page) | PTE_P | perm;
c0104803:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104806:	89 04 24             	mov    %eax,(%esp)
c0104809:	e8 a4 f2 ff ff       	call   c0103ab2 <page2pa>
c010480e:	0b 45 14             	or     0x14(%ebp),%eax
c0104811:	83 c8 01             	or     $0x1,%eax
c0104814:	89 c2                	mov    %eax,%edx
c0104816:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104819:	89 10                	mov    %edx,(%eax)
    tlb_invalidate(pgdir, la);
c010481b:	8b 45 10             	mov    0x10(%ebp),%eax
c010481e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0104822:	8b 45 08             	mov    0x8(%ebp),%eax
c0104825:	89 04 24             	mov    %eax,(%esp)
c0104828:	e8 07 00 00 00       	call   c0104834 <tlb_invalidate>
    return 0;
c010482d:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0104832:	c9                   	leave  
c0104833:	c3                   	ret    

c0104834 <tlb_invalidate>:

// invalidate a TLB entry, but only if the page tables being
// edited are the ones currently in use by the processor.
void
tlb_invalidate(pde_t *pgdir, uintptr_t la) {
c0104834:	f3 0f 1e fb          	endbr32 
c0104838:	55                   	push   %ebp
c0104839:	89 e5                	mov    %esp,%ebp
c010483b:	83 ec 28             	sub    $0x28,%esp
}

static inline uintptr_t
rcr3(void) {
    uintptr_t cr3;
    asm volatile ("mov %%cr3, %0" : "=r" (cr3) :: "memory");
c010483e:	0f 20 d8             	mov    %cr3,%eax
c0104841:	89 45 f0             	mov    %eax,-0x10(%ebp)
    return cr3;
c0104844:	8b 55 f0             	mov    -0x10(%ebp),%edx
    if (rcr3() == PADDR(pgdir)) {
c0104847:	8b 45 08             	mov    0x8(%ebp),%eax
c010484a:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010484d:	81 7d f4 ff ff ff bf 	cmpl   $0xbfffffff,-0xc(%ebp)
c0104854:	77 23                	ja     c0104879 <tlb_invalidate+0x45>
c0104856:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104859:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010485d:	c7 44 24 08 ac 9e 10 	movl   $0xc0109eac,0x8(%esp)
c0104864:	c0 
c0104865:	c7 44 24 04 f6 01 00 	movl   $0x1f6,0x4(%esp)
c010486c:	00 
c010486d:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104874:	e8 a8 bb ff ff       	call   c0100421 <__panic>
c0104879:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010487c:	05 00 00 00 40       	add    $0x40000000,%eax
c0104881:	39 d0                	cmp    %edx,%eax
c0104883:	75 0d                	jne    c0104892 <tlb_invalidate+0x5e>
        invlpg((void *)la);
c0104885:	8b 45 0c             	mov    0xc(%ebp),%eax
c0104888:	89 45 ec             	mov    %eax,-0x14(%ebp)
}

static inline void
invlpg(void *addr) {
    asm volatile ("invlpg (%0)" :: "r" (addr) : "memory");
c010488b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010488e:	0f 01 38             	invlpg (%eax)
}
c0104891:	90                   	nop
    }
}
c0104892:	90                   	nop
c0104893:	c9                   	leave  
c0104894:	c3                   	ret    

c0104895 <check_alloc_page>:

static void
check_alloc_page(void) {
c0104895:	f3 0f 1e fb          	endbr32 
c0104899:	55                   	push   %ebp
c010489a:	89 e5                	mov    %esp,%ebp
c010489c:	83 ec 18             	sub    $0x18,%esp
    pmm_manager->check();
c010489f:	a1 00 da 2a c0       	mov    0xc02ada00,%eax
c01048a4:	8b 40 18             	mov    0x18(%eax),%eax
c01048a7:	ff d0                	call   *%eax
    cprintf("check_alloc_page() succeeded!\n");
c01048a9:	c7 04 24 30 9f 10 c0 	movl   $0xc0109f30,(%esp)
c01048b0:	e8 00 ba ff ff       	call   c01002b5 <cprintf>
}
c01048b5:	90                   	nop
c01048b6:	c9                   	leave  
c01048b7:	c3                   	ret    

c01048b8 <check_pgdir>:

static void
check_pgdir(void) {
c01048b8:	f3 0f 1e fb          	endbr32 
c01048bc:	55                   	push   %ebp
c01048bd:	89 e5                	mov    %esp,%ebp
c01048bf:	83 ec 38             	sub    $0x38,%esp
    assert(npage <= KMEMSIZE / PGSIZE);
c01048c2:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c01048c7:	3d 00 80 03 00       	cmp    $0x38000,%eax
c01048cc:	76 24                	jbe    c01048f2 <check_pgdir+0x3a>
c01048ce:	c7 44 24 0c 4f 9f 10 	movl   $0xc0109f4f,0xc(%esp)
c01048d5:	c0 
c01048d6:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c01048dd:	c0 
c01048de:	c7 44 24 04 03 02 00 	movl   $0x203,0x4(%esp)
c01048e5:	00 
c01048e6:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01048ed:	e8 2f bb ff ff       	call   c0100421 <__panic>
    assert(boot_pgdir != NULL && (uint32_t)PGOFF(boot_pgdir) == 0);
c01048f2:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c01048f7:	85 c0                	test   %eax,%eax
c01048f9:	74 0e                	je     c0104909 <check_pgdir+0x51>
c01048fb:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104900:	25 ff 0f 00 00       	and    $0xfff,%eax
c0104905:	85 c0                	test   %eax,%eax
c0104907:	74 24                	je     c010492d <check_pgdir+0x75>
c0104909:	c7 44 24 0c 6c 9f 10 	movl   $0xc0109f6c,0xc(%esp)
c0104910:	c0 
c0104911:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104918:	c0 
c0104919:	c7 44 24 04 04 02 00 	movl   $0x204,0x4(%esp)
c0104920:	00 
c0104921:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104928:	e8 f4 ba ff ff       	call   c0100421 <__panic>
    assert(get_page(boot_pgdir, 0x0, NULL) == NULL);
c010492d:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104932:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104939:	00 
c010493a:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104941:	00 
c0104942:	89 04 24             	mov    %eax,(%esp)
c0104945:	e8 25 fd ff ff       	call   c010466f <get_page>
c010494a:	85 c0                	test   %eax,%eax
c010494c:	74 24                	je     c0104972 <check_pgdir+0xba>
c010494e:	c7 44 24 0c a4 9f 10 	movl   $0xc0109fa4,0xc(%esp)
c0104955:	c0 
c0104956:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c010495d:	c0 
c010495e:	c7 44 24 04 05 02 00 	movl   $0x205,0x4(%esp)
c0104965:	00 
c0104966:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c010496d:	e8 af ba ff ff       	call   c0100421 <__panic>

    struct Page *p1, *p2;
    p1 = alloc_page();
c0104972:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104979:	e8 59 f4 ff ff       	call   c0103dd7 <alloc_pages>
c010497e:	89 45 f4             	mov    %eax,-0xc(%ebp)
    assert(page_insert(boot_pgdir, p1, 0x0, 0) == 0);
c0104981:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104986:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c010498d:	00 
c010498e:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104995:	00 
c0104996:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0104999:	89 54 24 04          	mov    %edx,0x4(%esp)
c010499d:	89 04 24             	mov    %eax,(%esp)
c01049a0:	e8 d2 fd ff ff       	call   c0104777 <page_insert>
c01049a5:	85 c0                	test   %eax,%eax
c01049a7:	74 24                	je     c01049cd <check_pgdir+0x115>
c01049a9:	c7 44 24 0c cc 9f 10 	movl   $0xc0109fcc,0xc(%esp)
c01049b0:	c0 
c01049b1:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c01049b8:	c0 
c01049b9:	c7 44 24 04 09 02 00 	movl   $0x209,0x4(%esp)
c01049c0:	00 
c01049c1:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01049c8:	e8 54 ba ff ff       	call   c0100421 <__panic>

    pte_t *ptep;
    assert((ptep = get_pte(boot_pgdir, 0x0, 0)) != NULL);
c01049cd:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c01049d2:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c01049d9:	00 
c01049da:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c01049e1:	00 
c01049e2:	89 04 24             	mov    %eax,(%esp)
c01049e5:	e8 b4 fa ff ff       	call   c010449e <get_pte>
c01049ea:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01049ed:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c01049f1:	75 24                	jne    c0104a17 <check_pgdir+0x15f>
c01049f3:	c7 44 24 0c f8 9f 10 	movl   $0xc0109ff8,0xc(%esp)
c01049fa:	c0 
c01049fb:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104a02:	c0 
c0104a03:	c7 44 24 04 0c 02 00 	movl   $0x20c,0x4(%esp)
c0104a0a:	00 
c0104a0b:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104a12:	e8 0a ba ff ff       	call   c0100421 <__panic>
    assert(pte2page(*ptep) == p1);
c0104a17:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104a1a:	8b 00                	mov    (%eax),%eax
c0104a1c:	89 04 24             	mov    %eax,(%esp)
c0104a1f:	e8 47 f1 ff ff       	call   c0103b6b <pte2page>
c0104a24:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0104a27:	74 24                	je     c0104a4d <check_pgdir+0x195>
c0104a29:	c7 44 24 0c 25 a0 10 	movl   $0xc010a025,0xc(%esp)
c0104a30:	c0 
c0104a31:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104a38:	c0 
c0104a39:	c7 44 24 04 0d 02 00 	movl   $0x20d,0x4(%esp)
c0104a40:	00 
c0104a41:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104a48:	e8 d4 b9 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p1) == 1);
c0104a4d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104a50:	89 04 24             	mov    %eax,(%esp)
c0104a53:	e8 69 f1 ff ff       	call   c0103bc1 <page_ref>
c0104a58:	83 f8 01             	cmp    $0x1,%eax
c0104a5b:	74 24                	je     c0104a81 <check_pgdir+0x1c9>
c0104a5d:	c7 44 24 0c 3b a0 10 	movl   $0xc010a03b,0xc(%esp)
c0104a64:	c0 
c0104a65:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104a6c:	c0 
c0104a6d:	c7 44 24 04 0e 02 00 	movl   $0x20e,0x4(%esp)
c0104a74:	00 
c0104a75:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104a7c:	e8 a0 b9 ff ff       	call   c0100421 <__panic>

    ptep = &((pte_t *)KADDR(PDE_ADDR(boot_pgdir[0])))[1];
c0104a81:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104a86:	8b 00                	mov    (%eax),%eax
c0104a88:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0104a8d:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0104a90:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104a93:	c1 e8 0c             	shr    $0xc,%eax
c0104a96:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0104a99:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c0104a9e:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0104aa1:	72 23                	jb     c0104ac6 <check_pgdir+0x20e>
c0104aa3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104aa6:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104aaa:	c7 44 24 08 08 9e 10 	movl   $0xc0109e08,0x8(%esp)
c0104ab1:	c0 
c0104ab2:	c7 44 24 04 10 02 00 	movl   $0x210,0x4(%esp)
c0104ab9:	00 
c0104aba:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104ac1:	e8 5b b9 ff ff       	call   c0100421 <__panic>
c0104ac6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0104ac9:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104ace:	83 c0 04             	add    $0x4,%eax
c0104ad1:	89 45 f0             	mov    %eax,-0x10(%ebp)
    assert(get_pte(boot_pgdir, PGSIZE, 0) == ptep);
c0104ad4:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104ad9:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104ae0:	00 
c0104ae1:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104ae8:	00 
c0104ae9:	89 04 24             	mov    %eax,(%esp)
c0104aec:	e8 ad f9 ff ff       	call   c010449e <get_pte>
c0104af1:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0104af4:	74 24                	je     c0104b1a <check_pgdir+0x262>
c0104af6:	c7 44 24 0c 50 a0 10 	movl   $0xc010a050,0xc(%esp)
c0104afd:	c0 
c0104afe:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104b05:	c0 
c0104b06:	c7 44 24 04 11 02 00 	movl   $0x211,0x4(%esp)
c0104b0d:	00 
c0104b0e:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104b15:	e8 07 b9 ff ff       	call   c0100421 <__panic>

    p2 = alloc_page();
c0104b1a:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0104b21:	e8 b1 f2 ff ff       	call   c0103dd7 <alloc_pages>
c0104b26:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(page_insert(boot_pgdir, p2, PGSIZE, PTE_U | PTE_W) == 0);
c0104b29:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104b2e:	c7 44 24 0c 06 00 00 	movl   $0x6,0xc(%esp)
c0104b35:	00 
c0104b36:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104b3d:	00 
c0104b3e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0104b41:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104b45:	89 04 24             	mov    %eax,(%esp)
c0104b48:	e8 2a fc ff ff       	call   c0104777 <page_insert>
c0104b4d:	85 c0                	test   %eax,%eax
c0104b4f:	74 24                	je     c0104b75 <check_pgdir+0x2bd>
c0104b51:	c7 44 24 0c 78 a0 10 	movl   $0xc010a078,0xc(%esp)
c0104b58:	c0 
c0104b59:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104b60:	c0 
c0104b61:	c7 44 24 04 14 02 00 	movl   $0x214,0x4(%esp)
c0104b68:	00 
c0104b69:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104b70:	e8 ac b8 ff ff       	call   c0100421 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0104b75:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104b7a:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104b81:	00 
c0104b82:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104b89:	00 
c0104b8a:	89 04 24             	mov    %eax,(%esp)
c0104b8d:	e8 0c f9 ff ff       	call   c010449e <get_pte>
c0104b92:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104b95:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0104b99:	75 24                	jne    c0104bbf <check_pgdir+0x307>
c0104b9b:	c7 44 24 0c b0 a0 10 	movl   $0xc010a0b0,0xc(%esp)
c0104ba2:	c0 
c0104ba3:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104baa:	c0 
c0104bab:	c7 44 24 04 15 02 00 	movl   $0x215,0x4(%esp)
c0104bb2:	00 
c0104bb3:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104bba:	e8 62 b8 ff ff       	call   c0100421 <__panic>
    assert(*ptep & PTE_U);
c0104bbf:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104bc2:	8b 00                	mov    (%eax),%eax
c0104bc4:	83 e0 04             	and    $0x4,%eax
c0104bc7:	85 c0                	test   %eax,%eax
c0104bc9:	75 24                	jne    c0104bef <check_pgdir+0x337>
c0104bcb:	c7 44 24 0c e0 a0 10 	movl   $0xc010a0e0,0xc(%esp)
c0104bd2:	c0 
c0104bd3:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104bda:	c0 
c0104bdb:	c7 44 24 04 16 02 00 	movl   $0x216,0x4(%esp)
c0104be2:	00 
c0104be3:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104bea:	e8 32 b8 ff ff       	call   c0100421 <__panic>
    assert(*ptep & PTE_W);
c0104bef:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104bf2:	8b 00                	mov    (%eax),%eax
c0104bf4:	83 e0 02             	and    $0x2,%eax
c0104bf7:	85 c0                	test   %eax,%eax
c0104bf9:	75 24                	jne    c0104c1f <check_pgdir+0x367>
c0104bfb:	c7 44 24 0c ee a0 10 	movl   $0xc010a0ee,0xc(%esp)
c0104c02:	c0 
c0104c03:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104c0a:	c0 
c0104c0b:	c7 44 24 04 17 02 00 	movl   $0x217,0x4(%esp)
c0104c12:	00 
c0104c13:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104c1a:	e8 02 b8 ff ff       	call   c0100421 <__panic>
    assert(boot_pgdir[0] & PTE_U);
c0104c1f:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104c24:	8b 00                	mov    (%eax),%eax
c0104c26:	83 e0 04             	and    $0x4,%eax
c0104c29:	85 c0                	test   %eax,%eax
c0104c2b:	75 24                	jne    c0104c51 <check_pgdir+0x399>
c0104c2d:	c7 44 24 0c fc a0 10 	movl   $0xc010a0fc,0xc(%esp)
c0104c34:	c0 
c0104c35:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104c3c:	c0 
c0104c3d:	c7 44 24 04 18 02 00 	movl   $0x218,0x4(%esp)
c0104c44:	00 
c0104c45:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104c4c:	e8 d0 b7 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p2) == 1);
c0104c51:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104c54:	89 04 24             	mov    %eax,(%esp)
c0104c57:	e8 65 ef ff ff       	call   c0103bc1 <page_ref>
c0104c5c:	83 f8 01             	cmp    $0x1,%eax
c0104c5f:	74 24                	je     c0104c85 <check_pgdir+0x3cd>
c0104c61:	c7 44 24 0c 12 a1 10 	movl   $0xc010a112,0xc(%esp)
c0104c68:	c0 
c0104c69:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104c70:	c0 
c0104c71:	c7 44 24 04 19 02 00 	movl   $0x219,0x4(%esp)
c0104c78:	00 
c0104c79:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104c80:	e8 9c b7 ff ff       	call   c0100421 <__panic>

    assert(page_insert(boot_pgdir, p1, PGSIZE, 0) == 0);
c0104c85:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104c8a:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c0104c91:	00 
c0104c92:	c7 44 24 08 00 10 00 	movl   $0x1000,0x8(%esp)
c0104c99:	00 
c0104c9a:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0104c9d:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104ca1:	89 04 24             	mov    %eax,(%esp)
c0104ca4:	e8 ce fa ff ff       	call   c0104777 <page_insert>
c0104ca9:	85 c0                	test   %eax,%eax
c0104cab:	74 24                	je     c0104cd1 <check_pgdir+0x419>
c0104cad:	c7 44 24 0c 24 a1 10 	movl   $0xc010a124,0xc(%esp)
c0104cb4:	c0 
c0104cb5:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104cbc:	c0 
c0104cbd:	c7 44 24 04 1b 02 00 	movl   $0x21b,0x4(%esp)
c0104cc4:	00 
c0104cc5:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104ccc:	e8 50 b7 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p1) == 2);
c0104cd1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104cd4:	89 04 24             	mov    %eax,(%esp)
c0104cd7:	e8 e5 ee ff ff       	call   c0103bc1 <page_ref>
c0104cdc:	83 f8 02             	cmp    $0x2,%eax
c0104cdf:	74 24                	je     c0104d05 <check_pgdir+0x44d>
c0104ce1:	c7 44 24 0c 50 a1 10 	movl   $0xc010a150,0xc(%esp)
c0104ce8:	c0 
c0104ce9:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104cf0:	c0 
c0104cf1:	c7 44 24 04 1c 02 00 	movl   $0x21c,0x4(%esp)
c0104cf8:	00 
c0104cf9:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104d00:	e8 1c b7 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p2) == 0);
c0104d05:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104d08:	89 04 24             	mov    %eax,(%esp)
c0104d0b:	e8 b1 ee ff ff       	call   c0103bc1 <page_ref>
c0104d10:	85 c0                	test   %eax,%eax
c0104d12:	74 24                	je     c0104d38 <check_pgdir+0x480>
c0104d14:	c7 44 24 0c 62 a1 10 	movl   $0xc010a162,0xc(%esp)
c0104d1b:	c0 
c0104d1c:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104d23:	c0 
c0104d24:	c7 44 24 04 1d 02 00 	movl   $0x21d,0x4(%esp)
c0104d2b:	00 
c0104d2c:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104d33:	e8 e9 b6 ff ff       	call   c0100421 <__panic>
    assert((ptep = get_pte(boot_pgdir, PGSIZE, 0)) != NULL);
c0104d38:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104d3d:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104d44:	00 
c0104d45:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104d4c:	00 
c0104d4d:	89 04 24             	mov    %eax,(%esp)
c0104d50:	e8 49 f7 ff ff       	call   c010449e <get_pte>
c0104d55:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0104d58:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0104d5c:	75 24                	jne    c0104d82 <check_pgdir+0x4ca>
c0104d5e:	c7 44 24 0c b0 a0 10 	movl   $0xc010a0b0,0xc(%esp)
c0104d65:	c0 
c0104d66:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104d6d:	c0 
c0104d6e:	c7 44 24 04 1e 02 00 	movl   $0x21e,0x4(%esp)
c0104d75:	00 
c0104d76:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104d7d:	e8 9f b6 ff ff       	call   c0100421 <__panic>
    assert(pte2page(*ptep) == p1);
c0104d82:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104d85:	8b 00                	mov    (%eax),%eax
c0104d87:	89 04 24             	mov    %eax,(%esp)
c0104d8a:	e8 dc ed ff ff       	call   c0103b6b <pte2page>
c0104d8f:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0104d92:	74 24                	je     c0104db8 <check_pgdir+0x500>
c0104d94:	c7 44 24 0c 25 a0 10 	movl   $0xc010a025,0xc(%esp)
c0104d9b:	c0 
c0104d9c:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104da3:	c0 
c0104da4:	c7 44 24 04 1f 02 00 	movl   $0x21f,0x4(%esp)
c0104dab:	00 
c0104dac:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104db3:	e8 69 b6 ff ff       	call   c0100421 <__panic>
    assert((*ptep & PTE_U) == 0);
c0104db8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0104dbb:	8b 00                	mov    (%eax),%eax
c0104dbd:	83 e0 04             	and    $0x4,%eax
c0104dc0:	85 c0                	test   %eax,%eax
c0104dc2:	74 24                	je     c0104de8 <check_pgdir+0x530>
c0104dc4:	c7 44 24 0c 74 a1 10 	movl   $0xc010a174,0xc(%esp)
c0104dcb:	c0 
c0104dcc:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104dd3:	c0 
c0104dd4:	c7 44 24 04 20 02 00 	movl   $0x220,0x4(%esp)
c0104ddb:	00 
c0104ddc:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104de3:	e8 39 b6 ff ff       	call   c0100421 <__panic>

    page_remove(boot_pgdir, 0x0);
c0104de8:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104ded:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0104df4:	00 
c0104df5:	89 04 24             	mov    %eax,(%esp)
c0104df8:	e8 31 f9 ff ff       	call   c010472e <page_remove>
    assert(page_ref(p1) == 1);
c0104dfd:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104e00:	89 04 24             	mov    %eax,(%esp)
c0104e03:	e8 b9 ed ff ff       	call   c0103bc1 <page_ref>
c0104e08:	83 f8 01             	cmp    $0x1,%eax
c0104e0b:	74 24                	je     c0104e31 <check_pgdir+0x579>
c0104e0d:	c7 44 24 0c 3b a0 10 	movl   $0xc010a03b,0xc(%esp)
c0104e14:	c0 
c0104e15:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104e1c:	c0 
c0104e1d:	c7 44 24 04 23 02 00 	movl   $0x223,0x4(%esp)
c0104e24:	00 
c0104e25:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104e2c:	e8 f0 b5 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p2) == 0);
c0104e31:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104e34:	89 04 24             	mov    %eax,(%esp)
c0104e37:	e8 85 ed ff ff       	call   c0103bc1 <page_ref>
c0104e3c:	85 c0                	test   %eax,%eax
c0104e3e:	74 24                	je     c0104e64 <check_pgdir+0x5ac>
c0104e40:	c7 44 24 0c 62 a1 10 	movl   $0xc010a162,0xc(%esp)
c0104e47:	c0 
c0104e48:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104e4f:	c0 
c0104e50:	c7 44 24 04 24 02 00 	movl   $0x224,0x4(%esp)
c0104e57:	00 
c0104e58:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104e5f:	e8 bd b5 ff ff       	call   c0100421 <__panic>

    page_remove(boot_pgdir, PGSIZE);
c0104e64:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104e69:	c7 44 24 04 00 10 00 	movl   $0x1000,0x4(%esp)
c0104e70:	00 
c0104e71:	89 04 24             	mov    %eax,(%esp)
c0104e74:	e8 b5 f8 ff ff       	call   c010472e <page_remove>
    assert(page_ref(p1) == 0);
c0104e79:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104e7c:	89 04 24             	mov    %eax,(%esp)
c0104e7f:	e8 3d ed ff ff       	call   c0103bc1 <page_ref>
c0104e84:	85 c0                	test   %eax,%eax
c0104e86:	74 24                	je     c0104eac <check_pgdir+0x5f4>
c0104e88:	c7 44 24 0c 89 a1 10 	movl   $0xc010a189,0xc(%esp)
c0104e8f:	c0 
c0104e90:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104e97:	c0 
c0104e98:	c7 44 24 04 27 02 00 	movl   $0x227,0x4(%esp)
c0104e9f:	00 
c0104ea0:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104ea7:	e8 75 b5 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p2) == 0);
c0104eac:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104eaf:	89 04 24             	mov    %eax,(%esp)
c0104eb2:	e8 0a ed ff ff       	call   c0103bc1 <page_ref>
c0104eb7:	85 c0                	test   %eax,%eax
c0104eb9:	74 24                	je     c0104edf <check_pgdir+0x627>
c0104ebb:	c7 44 24 0c 62 a1 10 	movl   $0xc010a162,0xc(%esp)
c0104ec2:	c0 
c0104ec3:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104eca:	c0 
c0104ecb:	c7 44 24 04 28 02 00 	movl   $0x228,0x4(%esp)
c0104ed2:	00 
c0104ed3:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104eda:	e8 42 b5 ff ff       	call   c0100421 <__panic>

    assert(page_ref(pde2page(boot_pgdir[0])) == 1);
c0104edf:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104ee4:	8b 00                	mov    (%eax),%eax
c0104ee6:	89 04 24             	mov    %eax,(%esp)
c0104ee9:	e8 bb ec ff ff       	call   c0103ba9 <pde2page>
c0104eee:	89 04 24             	mov    %eax,(%esp)
c0104ef1:	e8 cb ec ff ff       	call   c0103bc1 <page_ref>
c0104ef6:	83 f8 01             	cmp    $0x1,%eax
c0104ef9:	74 24                	je     c0104f1f <check_pgdir+0x667>
c0104efb:	c7 44 24 0c 9c a1 10 	movl   $0xc010a19c,0xc(%esp)
c0104f02:	c0 
c0104f03:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104f0a:	c0 
c0104f0b:	c7 44 24 04 2a 02 00 	movl   $0x22a,0x4(%esp)
c0104f12:	00 
c0104f13:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104f1a:	e8 02 b5 ff ff       	call   c0100421 <__panic>
    free_page(pde2page(boot_pgdir[0]));
c0104f1f:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104f24:	8b 00                	mov    (%eax),%eax
c0104f26:	89 04 24             	mov    %eax,(%esp)
c0104f29:	e8 7b ec ff ff       	call   c0103ba9 <pde2page>
c0104f2e:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0104f35:	00 
c0104f36:	89 04 24             	mov    %eax,(%esp)
c0104f39:	e8 d5 ee ff ff       	call   c0103e13 <free_pages>
    boot_pgdir[0] = 0;
c0104f3e:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104f43:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_pgdir() succeeded!\n");
c0104f49:	c7 04 24 c3 a1 10 c0 	movl   $0xc010a1c3,(%esp)
c0104f50:	e8 60 b3 ff ff       	call   c01002b5 <cprintf>
}
c0104f55:	90                   	nop
c0104f56:	c9                   	leave  
c0104f57:	c3                   	ret    

c0104f58 <check_boot_pgdir>:

static void
check_boot_pgdir(void) {
c0104f58:	f3 0f 1e fb          	endbr32 
c0104f5c:	55                   	push   %ebp
c0104f5d:	89 e5                	mov    %esp,%ebp
c0104f5f:	83 ec 38             	sub    $0x38,%esp
    pte_t *ptep;
    int i;
    for (i = 0; i < npage; i += PGSIZE) {
c0104f62:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0104f69:	e9 ca 00 00 00       	jmp    c0105038 <check_boot_pgdir+0xe0>
        assert((ptep = get_pte(boot_pgdir, (uintptr_t)KADDR(i), 0)) != NULL);
c0104f6e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0104f71:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0104f74:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f77:	c1 e8 0c             	shr    $0xc,%eax
c0104f7a:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0104f7d:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c0104f82:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0104f85:	72 23                	jb     c0104faa <check_boot_pgdir+0x52>
c0104f87:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104f8a:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0104f8e:	c7 44 24 08 08 9e 10 	movl   $0xc0109e08,0x8(%esp)
c0104f95:	c0 
c0104f96:	c7 44 24 04 36 02 00 	movl   $0x236,0x4(%esp)
c0104f9d:	00 
c0104f9e:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104fa5:	e8 77 b4 ff ff       	call   c0100421 <__panic>
c0104faa:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0104fad:	2d 00 00 00 40       	sub    $0x40000000,%eax
c0104fb2:	89 c2                	mov    %eax,%edx
c0104fb4:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0104fb9:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c0104fc0:	00 
c0104fc1:	89 54 24 04          	mov    %edx,0x4(%esp)
c0104fc5:	89 04 24             	mov    %eax,(%esp)
c0104fc8:	e8 d1 f4 ff ff       	call   c010449e <get_pte>
c0104fcd:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0104fd0:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0104fd4:	75 24                	jne    c0104ffa <check_boot_pgdir+0xa2>
c0104fd6:	c7 44 24 0c e0 a1 10 	movl   $0xc010a1e0,0xc(%esp)
c0104fdd:	c0 
c0104fde:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0104fe5:	c0 
c0104fe6:	c7 44 24 04 36 02 00 	movl   $0x236,0x4(%esp)
c0104fed:	00 
c0104fee:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0104ff5:	e8 27 b4 ff ff       	call   c0100421 <__panic>
        assert(PTE_ADDR(*ptep) == i);
c0104ffa:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0104ffd:	8b 00                	mov    (%eax),%eax
c0104fff:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0105004:	89 c2                	mov    %eax,%edx
c0105006:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105009:	39 c2                	cmp    %eax,%edx
c010500b:	74 24                	je     c0105031 <check_boot_pgdir+0xd9>
c010500d:	c7 44 24 0c 1d a2 10 	movl   $0xc010a21d,0xc(%esp)
c0105014:	c0 
c0105015:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c010501c:	c0 
c010501d:	c7 44 24 04 37 02 00 	movl   $0x237,0x4(%esp)
c0105024:	00 
c0105025:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c010502c:	e8 f0 b3 ff ff       	call   c0100421 <__panic>
    for (i = 0; i < npage; i += PGSIZE) {
c0105031:	81 45 f4 00 10 00 00 	addl   $0x1000,-0xc(%ebp)
c0105038:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010503b:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c0105040:	39 c2                	cmp    %eax,%edx
c0105042:	0f 82 26 ff ff ff    	jb     c0104f6e <check_boot_pgdir+0x16>
    }

    assert(PDE_ADDR(boot_pgdir[PDX(VPT)]) == PADDR(boot_pgdir));
c0105048:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c010504d:	05 ac 0f 00 00       	add    $0xfac,%eax
c0105052:	8b 00                	mov    (%eax),%eax
c0105054:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0105059:	89 c2                	mov    %eax,%edx
c010505b:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0105060:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105063:	81 7d f0 ff ff ff bf 	cmpl   $0xbfffffff,-0x10(%ebp)
c010506a:	77 23                	ja     c010508f <check_boot_pgdir+0x137>
c010506c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010506f:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0105073:	c7 44 24 08 ac 9e 10 	movl   $0xc0109eac,0x8(%esp)
c010507a:	c0 
c010507b:	c7 44 24 04 3a 02 00 	movl   $0x23a,0x4(%esp)
c0105082:	00 
c0105083:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c010508a:	e8 92 b3 ff ff       	call   c0100421 <__panic>
c010508f:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105092:	05 00 00 00 40       	add    $0x40000000,%eax
c0105097:	39 d0                	cmp    %edx,%eax
c0105099:	74 24                	je     c01050bf <check_boot_pgdir+0x167>
c010509b:	c7 44 24 0c 34 a2 10 	movl   $0xc010a234,0xc(%esp)
c01050a2:	c0 
c01050a3:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c01050aa:	c0 
c01050ab:	c7 44 24 04 3a 02 00 	movl   $0x23a,0x4(%esp)
c01050b2:	00 
c01050b3:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01050ba:	e8 62 b3 ff ff       	call   c0100421 <__panic>

    assert(boot_pgdir[0] == 0);
c01050bf:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c01050c4:	8b 00                	mov    (%eax),%eax
c01050c6:	85 c0                	test   %eax,%eax
c01050c8:	74 24                	je     c01050ee <check_boot_pgdir+0x196>
c01050ca:	c7 44 24 0c 68 a2 10 	movl   $0xc010a268,0xc(%esp)
c01050d1:	c0 
c01050d2:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c01050d9:	c0 
c01050da:	c7 44 24 04 3c 02 00 	movl   $0x23c,0x4(%esp)
c01050e1:	00 
c01050e2:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01050e9:	e8 33 b3 ff ff       	call   c0100421 <__panic>

    struct Page *p;
    p = alloc_page();
c01050ee:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01050f5:	e8 dd ec ff ff       	call   c0103dd7 <alloc_pages>
c01050fa:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(page_insert(boot_pgdir, p, 0x100, PTE_W) == 0);
c01050fd:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0105102:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c0105109:	00 
c010510a:	c7 44 24 08 00 01 00 	movl   $0x100,0x8(%esp)
c0105111:	00 
c0105112:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105115:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105119:	89 04 24             	mov    %eax,(%esp)
c010511c:	e8 56 f6 ff ff       	call   c0104777 <page_insert>
c0105121:	85 c0                	test   %eax,%eax
c0105123:	74 24                	je     c0105149 <check_boot_pgdir+0x1f1>
c0105125:	c7 44 24 0c 7c a2 10 	movl   $0xc010a27c,0xc(%esp)
c010512c:	c0 
c010512d:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0105134:	c0 
c0105135:	c7 44 24 04 40 02 00 	movl   $0x240,0x4(%esp)
c010513c:	00 
c010513d:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0105144:	e8 d8 b2 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p) == 1);
c0105149:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010514c:	89 04 24             	mov    %eax,(%esp)
c010514f:	e8 6d ea ff ff       	call   c0103bc1 <page_ref>
c0105154:	83 f8 01             	cmp    $0x1,%eax
c0105157:	74 24                	je     c010517d <check_boot_pgdir+0x225>
c0105159:	c7 44 24 0c aa a2 10 	movl   $0xc010a2aa,0xc(%esp)
c0105160:	c0 
c0105161:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0105168:	c0 
c0105169:	c7 44 24 04 41 02 00 	movl   $0x241,0x4(%esp)
c0105170:	00 
c0105171:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0105178:	e8 a4 b2 ff ff       	call   c0100421 <__panic>
    assert(page_insert(boot_pgdir, p, 0x100 + PGSIZE, PTE_W) == 0);
c010517d:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c0105182:	c7 44 24 0c 02 00 00 	movl   $0x2,0xc(%esp)
c0105189:	00 
c010518a:	c7 44 24 08 00 11 00 	movl   $0x1100,0x8(%esp)
c0105191:	00 
c0105192:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0105195:	89 54 24 04          	mov    %edx,0x4(%esp)
c0105199:	89 04 24             	mov    %eax,(%esp)
c010519c:	e8 d6 f5 ff ff       	call   c0104777 <page_insert>
c01051a1:	85 c0                	test   %eax,%eax
c01051a3:	74 24                	je     c01051c9 <check_boot_pgdir+0x271>
c01051a5:	c7 44 24 0c bc a2 10 	movl   $0xc010a2bc,0xc(%esp)
c01051ac:	c0 
c01051ad:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c01051b4:	c0 
c01051b5:	c7 44 24 04 42 02 00 	movl   $0x242,0x4(%esp)
c01051bc:	00 
c01051bd:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01051c4:	e8 58 b2 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p) == 2);
c01051c9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01051cc:	89 04 24             	mov    %eax,(%esp)
c01051cf:	e8 ed e9 ff ff       	call   c0103bc1 <page_ref>
c01051d4:	83 f8 02             	cmp    $0x2,%eax
c01051d7:	74 24                	je     c01051fd <check_boot_pgdir+0x2a5>
c01051d9:	c7 44 24 0c f3 a2 10 	movl   $0xc010a2f3,0xc(%esp)
c01051e0:	c0 
c01051e1:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c01051e8:	c0 
c01051e9:	c7 44 24 04 43 02 00 	movl   $0x243,0x4(%esp)
c01051f0:	00 
c01051f1:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c01051f8:	e8 24 b2 ff ff       	call   c0100421 <__panic>

    const char *str = "ucore: Hello world!!";
c01051fd:	c7 45 e8 04 a3 10 c0 	movl   $0xc010a304,-0x18(%ebp)
    strcpy((void *)0x100, str);
c0105204:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105207:	89 44 24 04          	mov    %eax,0x4(%esp)
c010520b:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105212:	e8 e3 37 00 00       	call   c01089fa <strcpy>
    assert(strcmp((void *)0x100, (void *)(0x100 + PGSIZE)) == 0);
c0105217:	c7 44 24 04 00 11 00 	movl   $0x1100,0x4(%esp)
c010521e:	00 
c010521f:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c0105226:	e8 4d 38 00 00       	call   c0108a78 <strcmp>
c010522b:	85 c0                	test   %eax,%eax
c010522d:	74 24                	je     c0105253 <check_boot_pgdir+0x2fb>
c010522f:	c7 44 24 0c 1c a3 10 	movl   $0xc010a31c,0xc(%esp)
c0105236:	c0 
c0105237:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c010523e:	c0 
c010523f:	c7 44 24 04 47 02 00 	movl   $0x247,0x4(%esp)
c0105246:	00 
c0105247:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c010524e:	e8 ce b1 ff ff       	call   c0100421 <__panic>

    *(char *)(page2kva(p) + 0x100) = '\0';
c0105253:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105256:	89 04 24             	mov    %eax,(%esp)
c0105259:	e8 b9 e8 ff ff       	call   c0103b17 <page2kva>
c010525e:	05 00 01 00 00       	add    $0x100,%eax
c0105263:	c6 00 00             	movb   $0x0,(%eax)
    assert(strlen((const char *)0x100) == 0);
c0105266:	c7 04 24 00 01 00 00 	movl   $0x100,(%esp)
c010526d:	e8 2a 37 00 00       	call   c010899c <strlen>
c0105272:	85 c0                	test   %eax,%eax
c0105274:	74 24                	je     c010529a <check_boot_pgdir+0x342>
c0105276:	c7 44 24 0c 54 a3 10 	movl   $0xc010a354,0xc(%esp)
c010527d:	c0 
c010527e:	c7 44 24 08 f5 9e 10 	movl   $0xc0109ef5,0x8(%esp)
c0105285:	c0 
c0105286:	c7 44 24 04 4a 02 00 	movl   $0x24a,0x4(%esp)
c010528d:	00 
c010528e:	c7 04 24 d0 9e 10 c0 	movl   $0xc0109ed0,(%esp)
c0105295:	e8 87 b1 ff ff       	call   c0100421 <__panic>

    free_page(p);
c010529a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01052a1:	00 
c01052a2:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01052a5:	89 04 24             	mov    %eax,(%esp)
c01052a8:	e8 66 eb ff ff       	call   c0103e13 <free_pages>
    free_page(pde2page(boot_pgdir[0]));
c01052ad:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c01052b2:	8b 00                	mov    (%eax),%eax
c01052b4:	89 04 24             	mov    %eax,(%esp)
c01052b7:	e8 ed e8 ff ff       	call   c0103ba9 <pde2page>
c01052bc:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01052c3:	00 
c01052c4:	89 04 24             	mov    %eax,(%esp)
c01052c7:	e8 47 eb ff ff       	call   c0103e13 <free_pages>
    boot_pgdir[0] = 0;
c01052cc:	a1 e0 39 12 c0       	mov    0xc01239e0,%eax
c01052d1:	c7 00 00 00 00 00    	movl   $0x0,(%eax)

    cprintf("check_boot_pgdir() succeeded!\n");
c01052d7:	c7 04 24 78 a3 10 c0 	movl   $0xc010a378,(%esp)
c01052de:	e8 d2 af ff ff       	call   c01002b5 <cprintf>
}
c01052e3:	90                   	nop
c01052e4:	c9                   	leave  
c01052e5:	c3                   	ret    

c01052e6 <perm2str>:

//perm2str - use string 'u,r,w,-' to present the permission
static const char *
perm2str(int perm) {
c01052e6:	f3 0f 1e fb          	endbr32 
c01052ea:	55                   	push   %ebp
c01052eb:	89 e5                	mov    %esp,%ebp
    static char str[4];
    str[0] = (perm & PTE_U) ? 'u' : '-';
c01052ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01052f0:	83 e0 04             	and    $0x4,%eax
c01052f3:	85 c0                	test   %eax,%eax
c01052f5:	74 04                	je     c01052fb <perm2str+0x15>
c01052f7:	b0 75                	mov    $0x75,%al
c01052f9:	eb 02                	jmp    c01052fd <perm2str+0x17>
c01052fb:	b0 2d                	mov    $0x2d,%al
c01052fd:	a2 08 6f 12 c0       	mov    %al,0xc0126f08
    str[1] = 'r';
c0105302:	c6 05 09 6f 12 c0 72 	movb   $0x72,0xc0126f09
    str[2] = (perm & PTE_W) ? 'w' : '-';
c0105309:	8b 45 08             	mov    0x8(%ebp),%eax
c010530c:	83 e0 02             	and    $0x2,%eax
c010530f:	85 c0                	test   %eax,%eax
c0105311:	74 04                	je     c0105317 <perm2str+0x31>
c0105313:	b0 77                	mov    $0x77,%al
c0105315:	eb 02                	jmp    c0105319 <perm2str+0x33>
c0105317:	b0 2d                	mov    $0x2d,%al
c0105319:	a2 0a 6f 12 c0       	mov    %al,0xc0126f0a
    str[3] = '\0';
c010531e:	c6 05 0b 6f 12 c0 00 	movb   $0x0,0xc0126f0b
    return str;
c0105325:	b8 08 6f 12 c0       	mov    $0xc0126f08,%eax
}
c010532a:	5d                   	pop    %ebp
c010532b:	c3                   	ret    

c010532c <get_pgtable_items>:
//  table:       the beginning addr of table
//  left_store:  the pointer of the high side of table's next range
//  right_store: the pointer of the low side of table's next range
// return value: 0 - not a invalid item range, perm - a valid item range with perm permission 
static int
get_pgtable_items(size_t left, size_t right, size_t start, uintptr_t *table, size_t *left_store, size_t *right_store) {
c010532c:	f3 0f 1e fb          	endbr32 
c0105330:	55                   	push   %ebp
c0105331:	89 e5                	mov    %esp,%ebp
c0105333:	83 ec 10             	sub    $0x10,%esp
    if (start >= right) {
c0105336:	8b 45 10             	mov    0x10(%ebp),%eax
c0105339:	3b 45 0c             	cmp    0xc(%ebp),%eax
c010533c:	72 0d                	jb     c010534b <get_pgtable_items+0x1f>
        return 0;
c010533e:	b8 00 00 00 00       	mov    $0x0,%eax
c0105343:	e9 98 00 00 00       	jmp    c01053e0 <get_pgtable_items+0xb4>
    }
    while (start < right && !(table[start] & PTE_P)) {
        start ++;
c0105348:	ff 45 10             	incl   0x10(%ebp)
    while (start < right && !(table[start] & PTE_P)) {
c010534b:	8b 45 10             	mov    0x10(%ebp),%eax
c010534e:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105351:	73 18                	jae    c010536b <get_pgtable_items+0x3f>
c0105353:	8b 45 10             	mov    0x10(%ebp),%eax
c0105356:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c010535d:	8b 45 14             	mov    0x14(%ebp),%eax
c0105360:	01 d0                	add    %edx,%eax
c0105362:	8b 00                	mov    (%eax),%eax
c0105364:	83 e0 01             	and    $0x1,%eax
c0105367:	85 c0                	test   %eax,%eax
c0105369:	74 dd                	je     c0105348 <get_pgtable_items+0x1c>
    }
    if (start < right) {
c010536b:	8b 45 10             	mov    0x10(%ebp),%eax
c010536e:	3b 45 0c             	cmp    0xc(%ebp),%eax
c0105371:	73 68                	jae    c01053db <get_pgtable_items+0xaf>
        if (left_store != NULL) {
c0105373:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
c0105377:	74 08                	je     c0105381 <get_pgtable_items+0x55>
            *left_store = start;
c0105379:	8b 45 18             	mov    0x18(%ebp),%eax
c010537c:	8b 55 10             	mov    0x10(%ebp),%edx
c010537f:	89 10                	mov    %edx,(%eax)
        }
        int perm = (table[start ++] & PTE_USER);
c0105381:	8b 45 10             	mov    0x10(%ebp),%eax
c0105384:	8d 50 01             	lea    0x1(%eax),%edx
c0105387:	89 55 10             	mov    %edx,0x10(%ebp)
c010538a:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c0105391:	8b 45 14             	mov    0x14(%ebp),%eax
c0105394:	01 d0                	add    %edx,%eax
c0105396:	8b 00                	mov    (%eax),%eax
c0105398:	83 e0 07             	and    $0x7,%eax
c010539b:	89 45 fc             	mov    %eax,-0x4(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
c010539e:	eb 03                	jmp    c01053a3 <get_pgtable_items+0x77>
            start ++;
c01053a0:	ff 45 10             	incl   0x10(%ebp)
        while (start < right && (table[start] & PTE_USER) == perm) {
c01053a3:	8b 45 10             	mov    0x10(%ebp),%eax
c01053a6:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01053a9:	73 1d                	jae    c01053c8 <get_pgtable_items+0x9c>
c01053ab:	8b 45 10             	mov    0x10(%ebp),%eax
c01053ae:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx
c01053b5:	8b 45 14             	mov    0x14(%ebp),%eax
c01053b8:	01 d0                	add    %edx,%eax
c01053ba:	8b 00                	mov    (%eax),%eax
c01053bc:	83 e0 07             	and    $0x7,%eax
c01053bf:	89 c2                	mov    %eax,%edx
c01053c1:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01053c4:	39 c2                	cmp    %eax,%edx
c01053c6:	74 d8                	je     c01053a0 <get_pgtable_items+0x74>
        }
        if (right_store != NULL) {
c01053c8:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c01053cc:	74 08                	je     c01053d6 <get_pgtable_items+0xaa>
            *right_store = start;
c01053ce:	8b 45 1c             	mov    0x1c(%ebp),%eax
c01053d1:	8b 55 10             	mov    0x10(%ebp),%edx
c01053d4:	89 10                	mov    %edx,(%eax)
        }
        return perm;
c01053d6:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01053d9:	eb 05                	jmp    c01053e0 <get_pgtable_items+0xb4>
    }
    return 0;
c01053db:	b8 00 00 00 00       	mov    $0x0,%eax
}
c01053e0:	c9                   	leave  
c01053e1:	c3                   	ret    

c01053e2 <print_pgdir>:

//print_pgdir - print the PDT&PT
void
print_pgdir(void) {
c01053e2:	f3 0f 1e fb          	endbr32 
c01053e6:	55                   	push   %ebp
c01053e7:	89 e5                	mov    %esp,%ebp
c01053e9:	57                   	push   %edi
c01053ea:	56                   	push   %esi
c01053eb:	53                   	push   %ebx
c01053ec:	83 ec 4c             	sub    $0x4c,%esp
    cprintf("-------------------- BEGIN --------------------\n");
c01053ef:	c7 04 24 98 a3 10 c0 	movl   $0xc010a398,(%esp)
c01053f6:	e8 ba ae ff ff       	call   c01002b5 <cprintf>
    size_t left, right = 0, perm;
c01053fb:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c0105402:	e9 fa 00 00 00       	jmp    c0105501 <print_pgdir+0x11f>
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c0105407:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010540a:	89 04 24             	mov    %eax,(%esp)
c010540d:	e8 d4 fe ff ff       	call   c01052e6 <perm2str>
                left * PTSIZE, right * PTSIZE, (right - left) * PTSIZE, perm2str(perm));
c0105412:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0105415:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105418:	29 d1                	sub    %edx,%ecx
c010541a:	89 ca                	mov    %ecx,%edx
        cprintf("PDE(%03x) %08x-%08x %08x %s\n", right - left,
c010541c:	89 d6                	mov    %edx,%esi
c010541e:	c1 e6 16             	shl    $0x16,%esi
c0105421:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105424:	89 d3                	mov    %edx,%ebx
c0105426:	c1 e3 16             	shl    $0x16,%ebx
c0105429:	8b 55 e0             	mov    -0x20(%ebp),%edx
c010542c:	89 d1                	mov    %edx,%ecx
c010542e:	c1 e1 16             	shl    $0x16,%ecx
c0105431:	8b 7d dc             	mov    -0x24(%ebp),%edi
c0105434:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105437:	29 d7                	sub    %edx,%edi
c0105439:	89 fa                	mov    %edi,%edx
c010543b:	89 44 24 14          	mov    %eax,0x14(%esp)
c010543f:	89 74 24 10          	mov    %esi,0x10(%esp)
c0105443:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c0105447:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c010544b:	89 54 24 04          	mov    %edx,0x4(%esp)
c010544f:	c7 04 24 c9 a3 10 c0 	movl   $0xc010a3c9,(%esp)
c0105456:	e8 5a ae ff ff       	call   c01002b5 <cprintf>
        size_t l, r = left * NPTEENTRY;
c010545b:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010545e:	c1 e0 0a             	shl    $0xa,%eax
c0105461:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c0105464:	eb 54                	jmp    c01054ba <print_pgdir+0xd8>
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c0105466:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105469:	89 04 24             	mov    %eax,(%esp)
c010546c:	e8 75 fe ff ff       	call   c01052e6 <perm2str>
                    l * PGSIZE, r * PGSIZE, (r - l) * PGSIZE, perm2str(perm));
c0105471:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c0105474:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0105477:	29 d1                	sub    %edx,%ecx
c0105479:	89 ca                	mov    %ecx,%edx
            cprintf("  |-- PTE(%05x) %08x-%08x %08x %s\n", r - l,
c010547b:	89 d6                	mov    %edx,%esi
c010547d:	c1 e6 0c             	shl    $0xc,%esi
c0105480:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0105483:	89 d3                	mov    %edx,%ebx
c0105485:	c1 e3 0c             	shl    $0xc,%ebx
c0105488:	8b 55 d8             	mov    -0x28(%ebp),%edx
c010548b:	89 d1                	mov    %edx,%ecx
c010548d:	c1 e1 0c             	shl    $0xc,%ecx
c0105490:	8b 7d d4             	mov    -0x2c(%ebp),%edi
c0105493:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0105496:	29 d7                	sub    %edx,%edi
c0105498:	89 fa                	mov    %edi,%edx
c010549a:	89 44 24 14          	mov    %eax,0x14(%esp)
c010549e:	89 74 24 10          	mov    %esi,0x10(%esp)
c01054a2:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c01054a6:	89 4c 24 08          	mov    %ecx,0x8(%esp)
c01054aa:	89 54 24 04          	mov    %edx,0x4(%esp)
c01054ae:	c7 04 24 e8 a3 10 c0 	movl   $0xc010a3e8,(%esp)
c01054b5:	e8 fb ad ff ff       	call   c01002b5 <cprintf>
        while ((perm = get_pgtable_items(left * NPTEENTRY, right * NPTEENTRY, r, vpt, &l, &r)) != 0) {
c01054ba:	be 00 00 c0 fa       	mov    $0xfac00000,%esi
c01054bf:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01054c2:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01054c5:	89 d3                	mov    %edx,%ebx
c01054c7:	c1 e3 0a             	shl    $0xa,%ebx
c01054ca:	8b 55 e0             	mov    -0x20(%ebp),%edx
c01054cd:	89 d1                	mov    %edx,%ecx
c01054cf:	c1 e1 0a             	shl    $0xa,%ecx
c01054d2:	8d 55 d4             	lea    -0x2c(%ebp),%edx
c01054d5:	89 54 24 14          	mov    %edx,0x14(%esp)
c01054d9:	8d 55 d8             	lea    -0x28(%ebp),%edx
c01054dc:	89 54 24 10          	mov    %edx,0x10(%esp)
c01054e0:	89 74 24 0c          	mov    %esi,0xc(%esp)
c01054e4:	89 44 24 08          	mov    %eax,0x8(%esp)
c01054e8:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c01054ec:	89 0c 24             	mov    %ecx,(%esp)
c01054ef:	e8 38 fe ff ff       	call   c010532c <get_pgtable_items>
c01054f4:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01054f7:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c01054fb:	0f 85 65 ff ff ff    	jne    c0105466 <print_pgdir+0x84>
    while ((perm = get_pgtable_items(0, NPDEENTRY, right, vpd, &left, &right)) != 0) {
c0105501:	b9 00 b0 fe fa       	mov    $0xfafeb000,%ecx
c0105506:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105509:	8d 55 dc             	lea    -0x24(%ebp),%edx
c010550c:	89 54 24 14          	mov    %edx,0x14(%esp)
c0105510:	8d 55 e0             	lea    -0x20(%ebp),%edx
c0105513:	89 54 24 10          	mov    %edx,0x10(%esp)
c0105517:	89 4c 24 0c          	mov    %ecx,0xc(%esp)
c010551b:	89 44 24 08          	mov    %eax,0x8(%esp)
c010551f:	c7 44 24 04 00 04 00 	movl   $0x400,0x4(%esp)
c0105526:	00 
c0105527:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
c010552e:	e8 f9 fd ff ff       	call   c010532c <get_pgtable_items>
c0105533:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105536:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010553a:	0f 85 c7 fe ff ff    	jne    c0105407 <print_pgdir+0x25>
        }
    }
    cprintf("--------------------- END ---------------------\n");
c0105540:	c7 04 24 0c a4 10 c0 	movl   $0xc010a40c,(%esp)
c0105547:	e8 69 ad ff ff       	call   c01002b5 <cprintf>
}
c010554c:	90                   	nop
c010554d:	83 c4 4c             	add    $0x4c,%esp
c0105550:	5b                   	pop    %ebx
c0105551:	5e                   	pop    %esi
c0105552:	5f                   	pop    %edi
c0105553:	5d                   	pop    %ebp
c0105554:	c3                   	ret    

c0105555 <page2ppn>:
page2ppn(struct Page *page) {
c0105555:	55                   	push   %ebp
c0105556:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0105558:	a1 08 da 2a c0       	mov    0xc02ada08,%eax
c010555d:	8b 55 08             	mov    0x8(%ebp),%edx
c0105560:	29 c2                	sub    %eax,%edx
c0105562:	89 d0                	mov    %edx,%eax
c0105564:	c1 f8 02             	sar    $0x2,%eax
c0105567:	69 c0 39 8e e3 38    	imul   $0x38e38e39,%eax,%eax
}
c010556d:	5d                   	pop    %ebp
c010556e:	c3                   	ret    

c010556f <page2pa>:
page2pa(struct Page *page) {
c010556f:	55                   	push   %ebp
c0105570:	89 e5                	mov    %esp,%ebp
c0105572:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c0105575:	8b 45 08             	mov    0x8(%ebp),%eax
c0105578:	89 04 24             	mov    %eax,(%esp)
c010557b:	e8 d5 ff ff ff       	call   c0105555 <page2ppn>
c0105580:	c1 e0 0c             	shl    $0xc,%eax
}
c0105583:	c9                   	leave  
c0105584:	c3                   	ret    

c0105585 <page2kva>:
page2kva(struct Page *page) {
c0105585:	55                   	push   %ebp
c0105586:	89 e5                	mov    %esp,%ebp
c0105588:	83 ec 28             	sub    $0x28,%esp
    return KADDR(page2pa(page));
c010558b:	8b 45 08             	mov    0x8(%ebp),%eax
c010558e:	89 04 24             	mov    %eax,(%esp)
c0105591:	e8 d9 ff ff ff       	call   c010556f <page2pa>
c0105596:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105599:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010559c:	c1 e8 0c             	shr    $0xc,%eax
c010559f:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01055a2:	a1 80 6e 12 c0       	mov    0xc0126e80,%eax
c01055a7:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c01055aa:	72 23                	jb     c01055cf <page2kva+0x4a>
c01055ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01055af:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01055b3:	c7 44 24 08 40 a4 10 	movl   $0xc010a440,0x8(%esp)
c01055ba:	c0 
c01055bb:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
c01055c2:	00 
c01055c3:	c7 04 24 63 a4 10 c0 	movl   $0xc010a463,(%esp)
c01055ca:	e8 52 ae ff ff       	call   c0100421 <__panic>
c01055cf:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01055d2:	2d 00 00 00 40       	sub    $0x40000000,%eax
}
c01055d7:	c9                   	leave  
c01055d8:	c3                   	ret    

c01055d9 <kmem_sized_index>:
#define TEST_OBJECT_CTVAL 0x22
#define TEST_OBJECT_DTVAL 0x11
static const char *test_object_name = "test";

static int kmem_sized_index(size_t size) 
{
c01055d9:	f3 0f 1e fb          	endbr32 
c01055dd:	55                   	push   %ebp
c01055de:	89 e5                	mov    %esp,%ebp
c01055e0:	83 ec 20             	sub    $0x20,%esp
    // Round up 
    size_t rsize = ROUNDUP(size, 2);
c01055e3:	c7 45 f0 02 00 00 00 	movl   $0x2,-0x10(%ebp)
c01055ea:	8b 55 08             	mov    0x8(%ebp),%edx
c01055ed:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01055f0:	01 d0                	add    %edx,%eax
c01055f2:	48                   	dec    %eax
c01055f3:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01055f6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01055f9:	ba 00 00 00 00       	mov    $0x0,%edx
c01055fe:	f7 75 f0             	divl   -0x10(%ebp)
c0105601:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105604:	29 d0                	sub    %edx,%eax
c0105606:	89 45 fc             	mov    %eax,-0x4(%ebp)
    if (rsize < SIZED_CACHE_MIN)
c0105609:	83 7d fc 0f          	cmpl   $0xf,-0x4(%ebp)
c010560d:	77 07                	ja     c0105616 <kmem_sized_index+0x3d>
        rsize = SIZED_CACHE_MIN;
c010560f:	c7 45 fc 10 00 00 00 	movl   $0x10,-0x4(%ebp)
    // Find index
    int index = 0;
c0105616:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)
    for (int t = rsize / 32; t; t /= 2)
c010561d:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0105620:	c1 e8 05             	shr    $0x5,%eax
c0105623:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105626:	eb 12                	jmp    c010563a <kmem_sized_index+0x61>
        index ++;
c0105628:	ff 45 f8             	incl   -0x8(%ebp)
    for (int t = rsize / 32; t; t /= 2)
c010562b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010562e:	89 c2                	mov    %eax,%edx
c0105630:	c1 ea 1f             	shr    $0x1f,%edx
c0105633:	01 d0                	add    %edx,%eax
c0105635:	d1 f8                	sar    %eax
c0105637:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010563a:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010563e:	75 e8                	jne    c0105628 <kmem_sized_index+0x4f>
    return index;
c0105640:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0105643:	c9                   	leave  
c0105644:	c3                   	ret    

c0105645 <test_ctor>:

struct test_object {
    char test_member[TEST_OBJECT_LENTH];
};

static void test_ctor(void* objp, struct kmem_cache_t * cachep, size_t size) {
c0105645:	f3 0f 1e fb          	endbr32 
c0105649:	55                   	push   %ebp
c010564a:	89 e5                	mov    %esp,%ebp
c010564c:	83 ec 10             	sub    $0x10,%esp
    char *p = objp;
c010564f:	8b 45 08             	mov    0x8(%ebp),%eax
c0105652:	89 45 f8             	mov    %eax,-0x8(%ebp)
    for (int i = 0; i < size; i++)
c0105655:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c010565c:	eb 0e                	jmp    c010566c <test_ctor+0x27>
        p[i] = TEST_OBJECT_CTVAL;
c010565e:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0105661:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105664:	01 d0                	add    %edx,%eax
c0105666:	c6 00 22             	movb   $0x22,(%eax)
    for (int i = 0; i < size; i++)
c0105669:	ff 45 fc             	incl   -0x4(%ebp)
c010566c:	8b 45 fc             	mov    -0x4(%ebp),%eax
c010566f:	39 45 10             	cmp    %eax,0x10(%ebp)
c0105672:	77 ea                	ja     c010565e <test_ctor+0x19>
}
c0105674:	90                   	nop
c0105675:	90                   	nop
c0105676:	c9                   	leave  
c0105677:	c3                   	ret    

c0105678 <test_dtor>:

static void test_dtor(void* objp, struct kmem_cache_t * cachep, size_t size) {
c0105678:	f3 0f 1e fb          	endbr32 
c010567c:	55                   	push   %ebp
c010567d:	89 e5                	mov    %esp,%ebp
c010567f:	83 ec 10             	sub    $0x10,%esp
    char *p = objp;
c0105682:	8b 45 08             	mov    0x8(%ebp),%eax
c0105685:	89 45 f8             	mov    %eax,-0x8(%ebp)
    for (int i = 0; i < size; i++)
c0105688:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c010568f:	eb 0e                	jmp    c010569f <test_dtor+0x27>
        p[i] = TEST_OBJECT_DTVAL;
c0105691:	8b 55 fc             	mov    -0x4(%ebp),%edx
c0105694:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0105697:	01 d0                	add    %edx,%eax
c0105699:	c6 00 11             	movb   $0x11,(%eax)
    for (int i = 0; i < size; i++)
c010569c:	ff 45 fc             	incl   -0x4(%ebp)
c010569f:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01056a2:	39 45 10             	cmp    %eax,0x10(%ebp)
c01056a5:	77 ea                	ja     c0105691 <test_dtor+0x19>
}
c01056a7:	90                   	nop
c01056a8:	90                   	nop
c01056a9:	c9                   	leave  
c01056aa:	c3                   	ret    

c01056ab <list_length>:

static size_t list_length(list_entry_t *listelm) {
c01056ab:	f3 0f 1e fb          	endbr32 
c01056af:	55                   	push   %ebp
c01056b0:	89 e5                	mov    %esp,%ebp
c01056b2:	83 ec 10             	sub    $0x10,%esp
    size_t len = 0;
c01056b5:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    list_entry_t *le = listelm;
c01056bc:	8b 45 08             	mov    0x8(%ebp),%eax
c01056bf:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while ((le = list_next(le)) != listelm)
c01056c2:	eb 03                	jmp    c01056c7 <list_length+0x1c>
        len ++;
c01056c4:	ff 45 fc             	incl   -0x4(%ebp)
c01056c7:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01056ca:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01056cd:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01056d0:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != listelm)
c01056d3:	89 45 f8             	mov    %eax,-0x8(%ebp)
c01056d6:	8b 45 f8             	mov    -0x8(%ebp),%eax
c01056d9:	3b 45 08             	cmp    0x8(%ebp),%eax
c01056dc:	75 e6                	jne    c01056c4 <list_length+0x19>
    return len;
c01056de:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01056e1:	c9                   	leave  
c01056e2:	c3                   	ret    

c01056e3 <kmem_cache_grow>:

static void * kmem_cache_grow(struct kmem_cache_t *cachep) 
{
c01056e3:	f3 0f 1e fb          	endbr32 
c01056e7:	55                   	push   %ebp
c01056e8:	89 e5                	mov    %esp,%ebp
c01056ea:	83 ec 58             	sub    $0x58,%esp
    struct Page *page = alloc_page();
c01056ed:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01056f4:	e8 de e6 ff ff       	call   c0103dd7 <alloc_pages>
c01056f9:	89 45 ec             	mov    %eax,-0x14(%ebp)
    list_init(&(page->slab_link));
c01056fc:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01056ff:	83 c0 1c             	add    $0x1c,%eax
c0105702:	89 45 c0             	mov    %eax,-0x40(%ebp)
    elm->prev = elm->next = elm;
c0105705:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0105708:	8b 55 c0             	mov    -0x40(%ebp),%edx
c010570b:	89 50 04             	mov    %edx,0x4(%eax)
c010570e:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0105711:	8b 50 04             	mov    0x4(%eax),%edx
c0105714:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0105717:	89 10                	mov    %edx,(%eax)
}
c0105719:	90                   	nop
    void *kva = page2kva(page);
c010571a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010571d:	89 04 24             	mov    %eax,(%esp)
c0105720:	e8 60 fe ff ff       	call   c0105585 <page2kva>
c0105725:	89 45 e8             	mov    %eax,-0x18(%ebp)
    page->cachep = cachep;
c0105728:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010572b:	8b 55 08             	mov    0x8(%ebp),%edx
c010572e:	89 50 14             	mov    %edx,0x14(%eax)
    page->inuse = page->free = 0;
c0105731:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105734:	66 c7 40 1a 00 00    	movw   $0x0,0x1a(%eax)
c010573a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010573d:	0f b7 50 1a          	movzwl 0x1a(%eax),%edx
c0105741:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105744:	66 89 50 18          	mov    %dx,0x18(%eax)
    list_add(&(cachep->slabs_free), &(page->slab_link));
c0105748:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010574b:	83 c0 1c             	add    $0x1c,%eax
c010574e:	8b 55 08             	mov    0x8(%ebp),%edx
c0105751:	83 c2 10             	add    $0x10,%edx
c0105754:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0105757:	89 45 d8             	mov    %eax,-0x28(%ebp)
c010575a:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010575d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c0105760:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105763:	89 45 d0             	mov    %eax,-0x30(%ebp)
    __list_add(elm, listelm, listelm->next);
c0105766:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105769:	8b 40 04             	mov    0x4(%eax),%eax
c010576c:	8b 55 d0             	mov    -0x30(%ebp),%edx
c010576f:	89 55 cc             	mov    %edx,-0x34(%ebp)
c0105772:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0105775:	89 55 c8             	mov    %edx,-0x38(%ebp)
c0105778:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    prev->next = next->prev = elm;
c010577b:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010577e:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0105781:	89 10                	mov    %edx,(%eax)
c0105783:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0105786:	8b 10                	mov    (%eax),%edx
c0105788:	8b 45 c8             	mov    -0x38(%ebp),%eax
c010578b:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c010578e:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0105791:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0105794:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0105797:	8b 45 cc             	mov    -0x34(%ebp),%eax
c010579a:	8b 55 c8             	mov    -0x38(%ebp),%edx
c010579d:	89 10                	mov    %edx,(%eax)
}
c010579f:	90                   	nop
}
c01057a0:	90                   	nop
}
c01057a1:	90                   	nop

    int16_t *bufctl = kva;
c01057a2:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01057a5:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    for (int i = 1; i < cachep->num; i++)
c01057a8:	c7 45 f4 01 00 00 00 	movl   $0x1,-0xc(%ebp)
c01057af:	eb 1a                	jmp    c01057cb <kmem_cache_grow+0xe8>
        bufctl[i-1] = i;
c01057b1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01057b4:	05 ff ff ff 7f       	add    $0x7fffffff,%eax
c01057b9:	8d 14 00             	lea    (%eax,%eax,1),%edx
c01057bc:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01057bf:	01 c2                	add    %eax,%edx
c01057c1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01057c4:	98                   	cwtl   
c01057c5:	66 89 02             	mov    %ax,(%edx)
    for (int i = 1; i < cachep->num; i++)
c01057c8:	ff 45 f4             	incl   -0xc(%ebp)
c01057cb:	8b 45 08             	mov    0x8(%ebp),%eax
c01057ce:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c01057d2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c01057d5:	7c da                	jl     c01057b1 <kmem_cache_grow+0xce>
    bufctl[cachep->num-1] = -1;
c01057d7:	8b 45 08             	mov    0x8(%ebp),%eax
c01057da:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c01057de:	05 ff ff ff 7f       	add    $0x7fffffff,%eax
c01057e3:	8d 14 00             	lea    (%eax,%eax,1),%edx
c01057e6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01057e9:	01 d0                	add    %edx,%eax
c01057eb:	66 c7 00 ff ff       	movw   $0xffff,(%eax)

    void *buf = bufctl + cachep->num;
c01057f0:	8b 45 08             	mov    0x8(%ebp),%eax
c01057f3:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c01057f7:	8d 14 00             	lea    (%eax,%eax,1),%edx
c01057fa:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01057fd:	01 d0                	add    %edx,%eax
c01057ff:	89 45 e0             	mov    %eax,-0x20(%ebp)
    if (cachep->ctor) 
c0105802:	8b 45 08             	mov    0x8(%ebp),%eax
c0105805:	8b 40 1c             	mov    0x1c(%eax),%eax
c0105808:	85 c0                	test   %eax,%eax
c010580a:	74 51                	je     c010585d <kmem_cache_grow+0x17a>
        for (void *p = buf; p < buf + cachep->objsize * cachep->num; p += cachep->objsize)
c010580c:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010580f:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105812:	eb 2a                	jmp    c010583e <kmem_cache_grow+0x15b>
            cachep->ctor(p, cachep, cachep->objsize);
c0105814:	8b 45 08             	mov    0x8(%ebp),%eax
c0105817:	8b 40 1c             	mov    0x1c(%eax),%eax
c010581a:	8b 55 08             	mov    0x8(%ebp),%edx
c010581d:	0f b7 52 18          	movzwl 0x18(%edx),%edx
c0105821:	89 54 24 08          	mov    %edx,0x8(%esp)
c0105825:	8b 55 08             	mov    0x8(%ebp),%edx
c0105828:	89 54 24 04          	mov    %edx,0x4(%esp)
c010582c:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010582f:	89 14 24             	mov    %edx,(%esp)
c0105832:	ff d0                	call   *%eax
        for (void *p = buf; p < buf + cachep->objsize * cachep->num; p += cachep->objsize)
c0105834:	8b 45 08             	mov    0x8(%ebp),%eax
c0105837:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c010583b:	01 45 f0             	add    %eax,-0x10(%ebp)
c010583e:	8b 45 08             	mov    0x8(%ebp),%eax
c0105841:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c0105845:	89 c2                	mov    %eax,%edx
c0105847:	8b 45 08             	mov    0x8(%ebp),%eax
c010584a:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c010584e:	0f af c2             	imul   %edx,%eax
c0105851:	89 c2                	mov    %eax,%edx
c0105853:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105856:	01 d0                	add    %edx,%eax
c0105858:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c010585b:	72 b7                	jb     c0105814 <kmem_cache_grow+0x131>
    return page;
c010585d:	8b 45 ec             	mov    -0x14(%ebp),%eax
}
c0105860:	c9                   	leave  
c0105861:	c3                   	ret    

c0105862 <kmem_slab_destroy>:

static void kmem_slab_destroy(struct kmem_cache_t *cachep, struct Page *slab) 
{
c0105862:	f3 0f 1e fb          	endbr32 
c0105866:	55                   	push   %ebp
c0105867:	89 e5                	mov    %esp,%ebp
c0105869:	83 ec 38             	sub    $0x38,%esp
    int16_t *bufctl = page2kva(slab);
c010586c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010586f:	89 04 24             	mov    %eax,(%esp)
c0105872:	e8 0e fd ff ff       	call   c0105585 <page2kva>
c0105877:	89 45 f0             	mov    %eax,-0x10(%ebp)
    void *buf = bufctl + cachep->num;
c010587a:	8b 45 08             	mov    0x8(%ebp),%eax
c010587d:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c0105881:	8d 14 00             	lea    (%eax,%eax,1),%edx
c0105884:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105887:	01 d0                	add    %edx,%eax
c0105889:	89 45 ec             	mov    %eax,-0x14(%ebp)
    if (cachep->dtor)
c010588c:	8b 45 08             	mov    0x8(%ebp),%eax
c010588f:	8b 40 20             	mov    0x20(%eax),%eax
c0105892:	85 c0                	test   %eax,%eax
c0105894:	74 51                	je     c01058e7 <kmem_slab_destroy+0x85>
        for (void *p = buf; p < buf + cachep->objsize * cachep->num; p += cachep->objsize)
c0105896:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105899:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010589c:	eb 2a                	jmp    c01058c8 <kmem_slab_destroy+0x66>
            cachep->dtor(p, cachep, cachep->objsize);
c010589e:	8b 45 08             	mov    0x8(%ebp),%eax
c01058a1:	8b 40 20             	mov    0x20(%eax),%eax
c01058a4:	8b 55 08             	mov    0x8(%ebp),%edx
c01058a7:	0f b7 52 18          	movzwl 0x18(%edx),%edx
c01058ab:	89 54 24 08          	mov    %edx,0x8(%esp)
c01058af:	8b 55 08             	mov    0x8(%ebp),%edx
c01058b2:	89 54 24 04          	mov    %edx,0x4(%esp)
c01058b6:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01058b9:	89 14 24             	mov    %edx,(%esp)
c01058bc:	ff d0                	call   *%eax
        for (void *p = buf; p < buf + cachep->objsize * cachep->num; p += cachep->objsize)
c01058be:	8b 45 08             	mov    0x8(%ebp),%eax
c01058c1:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c01058c5:	01 45 f4             	add    %eax,-0xc(%ebp)
c01058c8:	8b 45 08             	mov    0x8(%ebp),%eax
c01058cb:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c01058cf:	89 c2                	mov    %eax,%edx
c01058d1:	8b 45 08             	mov    0x8(%ebp),%eax
c01058d4:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c01058d8:	0f af c2             	imul   %edx,%eax
c01058db:	89 c2                	mov    %eax,%edx
c01058dd:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01058e0:	01 d0                	add    %edx,%eax
c01058e2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c01058e5:	72 b7                	jb     c010589e <kmem_slab_destroy+0x3c>
    list_del(&(slab->slab_link));
c01058e7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01058ea:	83 c0 1c             	add    $0x1c,%eax
c01058ed:	89 45 e8             	mov    %eax,-0x18(%ebp)
    __list_del(listelm->prev, listelm->next);
c01058f0:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01058f3:	8b 40 04             	mov    0x4(%eax),%eax
c01058f6:	8b 55 e8             	mov    -0x18(%ebp),%edx
c01058f9:	8b 12                	mov    (%edx),%edx
c01058fb:	89 55 e4             	mov    %edx,-0x1c(%ebp)
c01058fe:	89 45 e0             	mov    %eax,-0x20(%ebp)
 * This is only for internal list manipulation where we know
 * the prev/next entries already!
 * */
static inline void
__list_del(list_entry_t *prev, list_entry_t *next) {
    prev->next = next;
c0105901:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105904:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105907:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c010590a:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010590d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105910:	89 10                	mov    %edx,(%eax)
}
c0105912:	90                   	nop
}
c0105913:	90                   	nop
    free_page(slab);
c0105914:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010591b:	00 
c010591c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010591f:	89 04 24             	mov    %eax,(%esp)
c0105922:	e8 ec e4 ff ff       	call   c0103e13 <free_pages>
}
c0105927:	90                   	nop
c0105928:	c9                   	leave  
c0105929:	c3                   	ret    

c010592a <kmem_cache_create>:

struct kmem_cache_t * kmem_cache_create(const char *name, size_t size, void (*ctor)(void*, struct kmem_cache_t *, size_t), void (*dtor)(void*, struct kmem_cache_t *, size_t)) 
{
c010592a:	f3 0f 1e fb          	endbr32 
c010592e:	55                   	push   %ebp
c010592f:	89 e5                	mov    %esp,%ebp
c0105931:	83 ec 48             	sub    $0x48,%esp
    assert(size <= (PGSIZE - 2));
c0105934:	81 7d 0c fe 0f 00 00 	cmpl   $0xffe,0xc(%ebp)
c010593b:	76 24                	jbe    c0105961 <kmem_cache_create+0x37>
c010593d:	c7 44 24 0c 82 a4 10 	movl   $0xc010a482,0xc(%esp)
c0105944:	c0 
c0105945:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c010594c:	c0 
c010594d:	c7 44 24 04 61 00 00 	movl   $0x61,0x4(%esp)
c0105954:	00 
c0105955:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c010595c:	e8 c0 aa ff ff       	call   c0100421 <__panic>
    struct kmem_cache_t *cachep = kmem_cache_alloc(&(cache_cache));
c0105961:	c7 04 24 40 6f 12 c0 	movl   $0xc0126f40,(%esp)
c0105968:	e8 1a 02 00 00       	call   c0105b87 <kmem_cache_alloc>
c010596d:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if (cachep != NULL) {
c0105970:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0105974:	0f 84 07 01 00 00    	je     c0105a81 <kmem_cache_create+0x157>
        cachep->objsize = size;
c010597a:	8b 45 0c             	mov    0xc(%ebp),%eax
c010597d:	0f b7 d0             	movzwl %ax,%edx
c0105980:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105983:	66 89 50 18          	mov    %dx,0x18(%eax)
        cachep->num = PGSIZE / (sizeof(int16_t) + size);
c0105987:	8b 45 0c             	mov    0xc(%ebp),%eax
c010598a:	8d 48 02             	lea    0x2(%eax),%ecx
c010598d:	b8 00 10 00 00       	mov    $0x1000,%eax
c0105992:	ba 00 00 00 00       	mov    $0x0,%edx
c0105997:	f7 f1                	div    %ecx
c0105999:	0f b7 d0             	movzwl %ax,%edx
c010599c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010599f:	66 89 50 1a          	mov    %dx,0x1a(%eax)
        cachep->ctor = ctor;
c01059a3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01059a6:	8b 55 10             	mov    0x10(%ebp),%edx
c01059a9:	89 50 1c             	mov    %edx,0x1c(%eax)
        cachep->dtor = dtor;
c01059ac:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01059af:	8b 55 14             	mov    0x14(%ebp),%edx
c01059b2:	89 50 20             	mov    %edx,0x20(%eax)
        memcpy(cachep->name, name, CACHE_NAMELEN);
c01059b5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01059b8:	8d 50 24             	lea    0x24(%eax),%edx
c01059bb:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c01059c2:	00 
c01059c3:	8b 45 08             	mov    0x8(%ebp),%eax
c01059c6:	89 44 24 04          	mov    %eax,0x4(%esp)
c01059ca:	89 14 24             	mov    %edx,(%esp)
c01059cd:	e8 f6 33 00 00       	call   c0108dc8 <memcpy>
        list_init(&(cachep->slabs_full));
c01059d2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01059d5:	89 45 cc             	mov    %eax,-0x34(%ebp)
    elm->prev = elm->next = elm;
c01059d8:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01059db:	8b 55 cc             	mov    -0x34(%ebp),%edx
c01059de:	89 50 04             	mov    %edx,0x4(%eax)
c01059e1:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01059e4:	8b 50 04             	mov    0x4(%eax),%edx
c01059e7:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01059ea:	89 10                	mov    %edx,(%eax)
}
c01059ec:	90                   	nop
        list_init(&(cachep->slabs_partial));
c01059ed:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01059f0:	83 c0 08             	add    $0x8,%eax
c01059f3:	89 45 d0             	mov    %eax,-0x30(%ebp)
    elm->prev = elm->next = elm;
c01059f6:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01059f9:	8b 55 d0             	mov    -0x30(%ebp),%edx
c01059fc:	89 50 04             	mov    %edx,0x4(%eax)
c01059ff:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105a02:	8b 50 04             	mov    0x4(%eax),%edx
c0105a05:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105a08:	89 10                	mov    %edx,(%eax)
}
c0105a0a:	90                   	nop
        list_init(&(cachep->slabs_free));
c0105a0b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105a0e:	83 c0 10             	add    $0x10,%eax
c0105a11:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    elm->prev = elm->next = elm;
c0105a14:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105a17:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0105a1a:	89 50 04             	mov    %edx,0x4(%eax)
c0105a1d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105a20:	8b 50 04             	mov    0x4(%eax),%edx
c0105a23:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105a26:	89 10                	mov    %edx,(%eax)
}
c0105a28:	90                   	nop
        list_add(&(cache_chain), &(cachep->cache_link));
c0105a29:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105a2c:	83 c0 34             	add    $0x34,%eax
c0105a2f:	c7 45 f0 20 6f 12 c0 	movl   $0xc0126f20,-0x10(%ebp)
c0105a36:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105a39:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105a3c:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105a3f:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105a42:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    __list_add(elm, listelm, listelm->next);
c0105a45:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105a48:	8b 40 04             	mov    0x4(%eax),%eax
c0105a4b:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105a4e:	89 55 e0             	mov    %edx,-0x20(%ebp)
c0105a51:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0105a54:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0105a57:	89 45 d8             	mov    %eax,-0x28(%ebp)
    prev->next = next->prev = elm;
c0105a5a:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105a5d:	8b 55 e0             	mov    -0x20(%ebp),%edx
c0105a60:	89 10                	mov    %edx,(%eax)
c0105a62:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105a65:	8b 10                	mov    (%eax),%edx
c0105a67:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105a6a:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0105a6d:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105a70:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0105a73:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0105a76:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105a79:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105a7c:	89 10                	mov    %edx,(%eax)
}
c0105a7e:	90                   	nop
}
c0105a7f:	90                   	nop
}
c0105a80:	90                   	nop
    }
    return cachep;
c0105a81:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105a84:	c9                   	leave  
c0105a85:	c3                   	ret    

c0105a86 <kmem_cache_destroy>:


void kmem_cache_destroy(struct kmem_cache_t *cachep) {
c0105a86:	f3 0f 1e fb          	endbr32 
c0105a8a:	55                   	push   %ebp
c0105a8b:	89 e5                	mov    %esp,%ebp
c0105a8d:	83 ec 48             	sub    $0x48,%esp
    list_entry_t *head, *le;
    // Destory full slabs
    head = &(cachep->slabs_full);
c0105a90:	8b 45 08             	mov    0x8(%ebp),%eax
c0105a93:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105a96:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105a99:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return listelm->next;
c0105a9c:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0105a9f:	8b 40 04             	mov    0x4(%eax),%eax
    le = list_next(head);
c0105aa2:	89 45 f4             	mov    %eax,-0xc(%ebp)
    while (le != head) {
c0105aa5:	eb 2a                	jmp    c0105ad1 <kmem_cache_destroy+0x4b>
        list_entry_t *temp = le;
c0105aa7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105aaa:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105aad:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105ab0:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0105ab3:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105ab6:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c0105ab9:	89 45 f4             	mov    %eax,-0xc(%ebp)
        kmem_slab_destroy(cachep, le2page(temp, slab_link));
c0105abc:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105abf:	83 e8 1c             	sub    $0x1c,%eax
c0105ac2:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105ac6:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ac9:	89 04 24             	mov    %eax,(%esp)
c0105acc:	e8 91 fd ff ff       	call   c0105862 <kmem_slab_destroy>
    while (le != head) {
c0105ad1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105ad4:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0105ad7:	75 ce                	jne    c0105aa7 <kmem_cache_destroy+0x21>
    }
    // Destory partial slabs 
    head = &(cachep->slabs_partial);
c0105ad9:	8b 45 08             	mov    0x8(%ebp),%eax
c0105adc:	83 c0 08             	add    $0x8,%eax
c0105adf:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105ae2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105ae5:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0105ae8:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105aeb:	8b 40 04             	mov    0x4(%eax),%eax
    le = list_next(head);
c0105aee:	89 45 f4             	mov    %eax,-0xc(%ebp)
    while (le != head) {
c0105af1:	eb 2a                	jmp    c0105b1d <kmem_cache_destroy+0x97>
        list_entry_t *temp = le;
c0105af3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105af6:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0105af9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105afc:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c0105aff:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105b02:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c0105b05:	89 45 f4             	mov    %eax,-0xc(%ebp)
        kmem_slab_destroy(cachep, le2page(temp, slab_link));
c0105b08:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105b0b:	83 e8 1c             	sub    $0x1c,%eax
c0105b0e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105b12:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b15:	89 04 24             	mov    %eax,(%esp)
c0105b18:	e8 45 fd ff ff       	call   c0105862 <kmem_slab_destroy>
    while (le != head) {
c0105b1d:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105b20:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0105b23:	75 ce                	jne    c0105af3 <kmem_cache_destroy+0x6d>
    }
    // Destory free slabs 
    head = &(cachep->slabs_free);
c0105b25:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b28:	83 c0 10             	add    $0x10,%eax
c0105b2b:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105b2e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105b31:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0105b34:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105b37:	8b 40 04             	mov    0x4(%eax),%eax
    le = list_next(head);
c0105b3a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    while (le != head) {
c0105b3d:	eb 2a                	jmp    c0105b69 <kmem_cache_destroy+0xe3>
        list_entry_t *temp = le;
c0105b3f:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105b42:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105b45:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105b48:	89 45 cc             	mov    %eax,-0x34(%ebp)
c0105b4b:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0105b4e:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c0105b51:	89 45 f4             	mov    %eax,-0xc(%ebp)
        kmem_slab_destroy(cachep, le2page(temp, slab_link));
c0105b54:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105b57:	83 e8 1c             	sub    $0x1c,%eax
c0105b5a:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105b5e:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b61:	89 04 24             	mov    %eax,(%esp)
c0105b64:	e8 f9 fc ff ff       	call   c0105862 <kmem_slab_destroy>
    while (le != head) {
c0105b69:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105b6c:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0105b6f:	75 ce                	jne    c0105b3f <kmem_cache_destroy+0xb9>
    }
    // Free kmem_cache 
    kmem_cache_free(&(cache_cache), cachep);
c0105b71:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b74:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105b78:	c7 04 24 40 6f 12 c0 	movl   $0xc0126f40,(%esp)
c0105b7f:	e8 f5 01 00 00       	call   c0105d79 <kmem_cache_free>
}
c0105b84:	90                   	nop
c0105b85:	c9                   	leave  
c0105b86:	c3                   	ret    

c0105b87 <kmem_cache_alloc>:

void * kmem_cache_alloc(struct kmem_cache_t *cachep) 
{
c0105b87:	f3 0f 1e fb          	endbr32 
c0105b8b:	55                   	push   %ebp
c0105b8c:	89 e5                	mov    %esp,%ebp
c0105b8e:	81 ec 88 00 00 00    	sub    $0x88,%esp
    list_entry_t *le = NULL;
c0105b94:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    // Find in partial list 
    if (!list_empty(&(cachep->slabs_partial)))
c0105b9b:	8b 45 08             	mov    0x8(%ebp),%eax
c0105b9e:	83 c0 08             	add    $0x8,%eax
c0105ba1:	89 45 dc             	mov    %eax,-0x24(%ebp)
    return list->next == list;
c0105ba4:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105ba7:	8b 40 04             	mov    0x4(%eax),%eax
c0105baa:	39 45 dc             	cmp    %eax,-0x24(%ebp)
c0105bad:	0f 94 c0             	sete   %al
c0105bb0:	0f b6 c0             	movzbl %al,%eax
c0105bb3:	85 c0                	test   %eax,%eax
c0105bb5:	75 14                	jne    c0105bcb <kmem_cache_alloc+0x44>
        le = list_next(&(cachep->slabs_partial));
c0105bb7:	8b 45 08             	mov    0x8(%ebp),%eax
c0105bba:	83 c0 08             	add    $0x8,%eax
c0105bbd:	89 45 d8             	mov    %eax,-0x28(%ebp)
    return listelm->next;
c0105bc0:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105bc3:	8b 40 04             	mov    0x4(%eax),%eax
c0105bc6:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105bc9:	eb 47                	jmp    c0105c12 <kmem_cache_alloc+0x8b>
    // Find in empty list 
    else 
    {
        if (list_empty(&(cachep->slabs_free)) && kmem_cache_grow(cachep) == NULL)
c0105bcb:	8b 45 08             	mov    0x8(%ebp),%eax
c0105bce:	83 c0 10             	add    $0x10,%eax
c0105bd1:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    return list->next == list;
c0105bd4:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105bd7:	8b 40 04             	mov    0x4(%eax),%eax
c0105bda:	39 45 d4             	cmp    %eax,-0x2c(%ebp)
c0105bdd:	0f 94 c0             	sete   %al
c0105be0:	0f b6 c0             	movzbl %al,%eax
c0105be3:	85 c0                	test   %eax,%eax
c0105be5:	74 19                	je     c0105c00 <kmem_cache_alloc+0x79>
c0105be7:	8b 45 08             	mov    0x8(%ebp),%eax
c0105bea:	89 04 24             	mov    %eax,(%esp)
c0105bed:	e8 f1 fa ff ff       	call   c01056e3 <kmem_cache_grow>
c0105bf2:	85 c0                	test   %eax,%eax
c0105bf4:	75 0a                	jne    c0105c00 <kmem_cache_alloc+0x79>
            return NULL;
c0105bf6:	b8 00 00 00 00       	mov    $0x0,%eax
c0105bfb:	e9 77 01 00 00       	jmp    c0105d77 <kmem_cache_alloc+0x1f0>
        le = list_next(&(cachep->slabs_free));
c0105c00:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c03:	83 c0 10             	add    $0x10,%eax
c0105c06:	89 45 d0             	mov    %eax,-0x30(%ebp)
    return listelm->next;
c0105c09:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105c0c:	8b 40 04             	mov    0x4(%eax),%eax
c0105c0f:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0105c12:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105c15:	89 45 cc             	mov    %eax,-0x34(%ebp)
    __list_del(listelm->prev, listelm->next);
c0105c18:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0105c1b:	8b 40 04             	mov    0x4(%eax),%eax
c0105c1e:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0105c21:	8b 12                	mov    (%edx),%edx
c0105c23:	89 55 c8             	mov    %edx,-0x38(%ebp)
c0105c26:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    prev->next = next;
c0105c29:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0105c2c:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0105c2f:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0105c32:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0105c35:	8b 55 c8             	mov    -0x38(%ebp),%edx
c0105c38:	89 10                	mov    %edx,(%eax)
}
c0105c3a:	90                   	nop
}
c0105c3b:	90                   	nop
    }
    // Alloc 
    list_del(le);
    struct Page *slab = le2page(le, slab_link);
c0105c3c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105c3f:	83 e8 1c             	sub    $0x1c,%eax
c0105c42:	89 45 f0             	mov    %eax,-0x10(%ebp)
    void *kva = page2kva(slab);
c0105c45:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105c48:	89 04 24             	mov    %eax,(%esp)
c0105c4b:	e8 35 f9 ff ff       	call   c0105585 <page2kva>
c0105c50:	89 45 ec             	mov    %eax,-0x14(%ebp)
    int16_t *bufctl = kva;
c0105c53:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105c56:	89 45 e8             	mov    %eax,-0x18(%ebp)
    void *buf = bufctl + cachep->num;
c0105c59:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c5c:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c0105c60:	8d 14 00             	lea    (%eax,%eax,1),%edx
c0105c63:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105c66:	01 d0                	add    %edx,%eax
c0105c68:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    void *objp = buf + slab->free * cachep->objsize;
c0105c6b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105c6e:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c0105c72:	89 c2                	mov    %eax,%edx
c0105c74:	8b 45 08             	mov    0x8(%ebp),%eax
c0105c77:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c0105c7b:	0f af c2             	imul   %edx,%eax
c0105c7e:	89 c2                	mov    %eax,%edx
c0105c80:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105c83:	01 d0                	add    %edx,%eax
c0105c85:	89 45 e0             	mov    %eax,-0x20(%ebp)
    // Update slab
    slab->inuse ++;
c0105c88:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105c8b:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c0105c8f:	40                   	inc    %eax
c0105c90:	0f b7 d0             	movzwl %ax,%edx
c0105c93:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105c96:	66 89 50 18          	mov    %dx,0x18(%eax)
    slab->free = bufctl[slab->free];
c0105c9a:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105c9d:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c0105ca1:	8d 14 00             	lea    (%eax,%eax,1),%edx
c0105ca4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105ca7:	01 d0                	add    %edx,%eax
c0105ca9:	0f bf 00             	movswl (%eax),%eax
c0105cac:	0f b7 d0             	movzwl %ax,%edx
c0105caf:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105cb2:	66 89 50 1a          	mov    %dx,0x1a(%eax)
    if (slab->inuse == cachep->num)
c0105cb6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105cb9:	0f b7 50 18          	movzwl 0x18(%eax),%edx
c0105cbd:	8b 45 08             	mov    0x8(%ebp),%eax
c0105cc0:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c0105cc4:	39 c2                	cmp    %eax,%edx
c0105cc6:	75 55                	jne    c0105d1d <kmem_cache_alloc+0x196>
        list_add(&(cachep->slabs_full), le);
c0105cc8:	8b 45 08             	mov    0x8(%ebp),%eax
c0105ccb:	89 45 c0             	mov    %eax,-0x40(%ebp)
c0105cce:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105cd1:	89 45 bc             	mov    %eax,-0x44(%ebp)
c0105cd4:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0105cd7:	89 45 b8             	mov    %eax,-0x48(%ebp)
c0105cda:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0105cdd:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    __list_add(elm, listelm, listelm->next);
c0105ce0:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0105ce3:	8b 40 04             	mov    0x4(%eax),%eax
c0105ce6:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0105ce9:	89 55 b0             	mov    %edx,-0x50(%ebp)
c0105cec:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0105cef:	89 55 ac             	mov    %edx,-0x54(%ebp)
c0105cf2:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next->prev = elm;
c0105cf5:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0105cf8:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0105cfb:	89 10                	mov    %edx,(%eax)
c0105cfd:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0105d00:	8b 10                	mov    (%eax),%edx
c0105d02:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0105d05:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0105d08:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0105d0b:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0105d0e:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0105d11:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0105d14:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0105d17:	89 10                	mov    %edx,(%eax)
}
c0105d19:	90                   	nop
}
c0105d1a:	90                   	nop
}
c0105d1b:	eb 57                	jmp    c0105d74 <kmem_cache_alloc+0x1ed>
    else 
        list_add(&(cachep->slabs_partial), le);
c0105d1d:	8b 45 08             	mov    0x8(%ebp),%eax
c0105d20:	83 c0 08             	add    $0x8,%eax
c0105d23:	89 45 a4             	mov    %eax,-0x5c(%ebp)
c0105d26:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0105d29:	89 45 a0             	mov    %eax,-0x60(%ebp)
c0105d2c:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0105d2f:	89 45 9c             	mov    %eax,-0x64(%ebp)
c0105d32:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0105d35:	89 45 98             	mov    %eax,-0x68(%ebp)
    __list_add(elm, listelm, listelm->next);
c0105d38:	8b 45 9c             	mov    -0x64(%ebp),%eax
c0105d3b:	8b 40 04             	mov    0x4(%eax),%eax
c0105d3e:	8b 55 98             	mov    -0x68(%ebp),%edx
c0105d41:	89 55 94             	mov    %edx,-0x6c(%ebp)
c0105d44:	8b 55 9c             	mov    -0x64(%ebp),%edx
c0105d47:	89 55 90             	mov    %edx,-0x70(%ebp)
c0105d4a:	89 45 8c             	mov    %eax,-0x74(%ebp)
    prev->next = next->prev = elm;
c0105d4d:	8b 45 8c             	mov    -0x74(%ebp),%eax
c0105d50:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0105d53:	89 10                	mov    %edx,(%eax)
c0105d55:	8b 45 8c             	mov    -0x74(%ebp),%eax
c0105d58:	8b 10                	mov    (%eax),%edx
c0105d5a:	8b 45 90             	mov    -0x70(%ebp),%eax
c0105d5d:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0105d60:	8b 45 94             	mov    -0x6c(%ebp),%eax
c0105d63:	8b 55 8c             	mov    -0x74(%ebp),%edx
c0105d66:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0105d69:	8b 45 94             	mov    -0x6c(%ebp),%eax
c0105d6c:	8b 55 90             	mov    -0x70(%ebp),%edx
c0105d6f:	89 10                	mov    %edx,(%eax)
}
c0105d71:	90                   	nop
}
c0105d72:	90                   	nop
}
c0105d73:	90                   	nop
    return objp;
c0105d74:	8b 45 e0             	mov    -0x20(%ebp),%eax
}
c0105d77:	c9                   	leave  
c0105d78:	c3                   	ret    

c0105d79 <kmem_cache_free>:

void kmem_cache_free(struct kmem_cache_t *cachep, void *objp) 
{
c0105d79:	f3 0f 1e fb          	endbr32 
c0105d7d:	55                   	push   %ebp
c0105d7e:	89 e5                	mov    %esp,%ebp
c0105d80:	83 ec 78             	sub    $0x78,%esp
    // Get slab of object 
    void *base = page2kva(pages);
c0105d83:	a1 08 da 2a c0       	mov    0xc02ada08,%eax
c0105d88:	89 04 24             	mov    %eax,(%esp)
c0105d8b:	e8 f5 f7 ff ff       	call   c0105585 <page2kva>
c0105d90:	89 45 f4             	mov    %eax,-0xc(%ebp)
    void *kva = ROUNDDOWN(objp, PGSIZE);
c0105d93:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105d96:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105d99:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105d9c:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c0105da1:	89 45 ec             	mov    %eax,-0x14(%ebp)
    struct Page *slab =  &pages[(kva-base)/PGSIZE];
c0105da4:	8b 0d 08 da 2a c0    	mov    0xc02ada08,%ecx
c0105daa:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105dad:	2b 45 f4             	sub    -0xc(%ebp),%eax
c0105db0:	8d 90 ff 0f 00 00    	lea    0xfff(%eax),%edx
c0105db6:	85 c0                	test   %eax,%eax
c0105db8:	0f 48 c2             	cmovs  %edx,%eax
c0105dbb:	c1 f8 0c             	sar    $0xc,%eax
c0105dbe:	89 c2                	mov    %eax,%edx
c0105dc0:	89 d0                	mov    %edx,%eax
c0105dc2:	c1 e0 03             	shl    $0x3,%eax
c0105dc5:	01 d0                	add    %edx,%eax
c0105dc7:	c1 e0 02             	shl    $0x2,%eax
c0105dca:	01 c8                	add    %ecx,%eax
c0105dcc:	89 45 e8             	mov    %eax,-0x18(%ebp)
    // Get offset in slab
    int16_t *bufctl = kva;
c0105dcf:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105dd2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    void *buf = bufctl + cachep->num;
c0105dd5:	8b 45 08             	mov    0x8(%ebp),%eax
c0105dd8:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c0105ddc:	8d 14 00             	lea    (%eax,%eax,1),%edx
c0105ddf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105de2:	01 d0                	add    %edx,%eax
c0105de4:	89 45 e0             	mov    %eax,-0x20(%ebp)
    int offset = (objp - buf) / cachep->objsize;
c0105de7:	8b 45 0c             	mov    0xc(%ebp),%eax
c0105dea:	2b 45 e0             	sub    -0x20(%ebp),%eax
c0105ded:	8b 55 08             	mov    0x8(%ebp),%edx
c0105df0:	0f b7 52 18          	movzwl 0x18(%edx),%edx
c0105df4:	89 d1                	mov    %edx,%ecx
c0105df6:	99                   	cltd   
c0105df7:	f7 f9                	idiv   %ecx
c0105df9:	89 45 dc             	mov    %eax,-0x24(%ebp)
    // Update slab 
    list_del(&(slab->slab_link));
c0105dfc:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105dff:	83 c0 1c             	add    $0x1c,%eax
c0105e02:	89 45 d8             	mov    %eax,-0x28(%ebp)
    __list_del(listelm->prev, listelm->next);
c0105e05:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0105e08:	8b 40 04             	mov    0x4(%eax),%eax
c0105e0b:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0105e0e:	8b 12                	mov    (%edx),%edx
c0105e10:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0105e13:	89 45 d0             	mov    %eax,-0x30(%ebp)
    prev->next = next;
c0105e16:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0105e19:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0105e1c:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0105e1f:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0105e22:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0105e25:	89 10                	mov    %edx,(%eax)
}
c0105e27:	90                   	nop
}
c0105e28:	90                   	nop
    bufctl[offset] = slab->free;
c0105e29:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105e2c:	0f b7 40 1a          	movzwl 0x1a(%eax),%eax
c0105e30:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0105e33:	8d 0c 12             	lea    (%edx,%edx,1),%ecx
c0105e36:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0105e39:	01 ca                	add    %ecx,%edx
c0105e3b:	98                   	cwtl   
c0105e3c:	66 89 02             	mov    %ax,(%edx)
    slab->inuse --;
c0105e3f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105e42:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c0105e46:	48                   	dec    %eax
c0105e47:	0f b7 d0             	movzwl %ax,%edx
c0105e4a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105e4d:	66 89 50 18          	mov    %dx,0x18(%eax)
    slab->free = offset;
c0105e51:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0105e54:	0f b7 d0             	movzwl %ax,%edx
c0105e57:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105e5a:	66 89 50 1a          	mov    %dx,0x1a(%eax)
    if (slab->inuse == 0)
c0105e5e:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105e61:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c0105e65:	85 c0                	test   %eax,%eax
c0105e67:	75 5b                	jne    c0105ec4 <kmem_cache_free+0x14b>
        list_add(&(cachep->slabs_free), &(slab->slab_link));
c0105e69:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105e6c:	83 c0 1c             	add    $0x1c,%eax
c0105e6f:	8b 55 08             	mov    0x8(%ebp),%edx
c0105e72:	83 c2 10             	add    $0x10,%edx
c0105e75:	89 55 cc             	mov    %edx,-0x34(%ebp)
c0105e78:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0105e7b:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0105e7e:	89 45 c4             	mov    %eax,-0x3c(%ebp)
c0105e81:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0105e84:	89 45 c0             	mov    %eax,-0x40(%ebp)
    __list_add(elm, listelm, listelm->next);
c0105e87:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0105e8a:	8b 40 04             	mov    0x4(%eax),%eax
c0105e8d:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0105e90:	89 55 bc             	mov    %edx,-0x44(%ebp)
c0105e93:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0105e96:	89 55 b8             	mov    %edx,-0x48(%ebp)
c0105e99:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    prev->next = next->prev = elm;
c0105e9c:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0105e9f:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0105ea2:	89 10                	mov    %edx,(%eax)
c0105ea4:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0105ea7:	8b 10                	mov    (%eax),%edx
c0105ea9:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0105eac:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0105eaf:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0105eb2:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0105eb5:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0105eb8:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0105ebb:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0105ebe:	89 10                	mov    %edx,(%eax)
}
c0105ec0:	90                   	nop
}
c0105ec1:	90                   	nop
}
c0105ec2:	eb 5a                	jmp    c0105f1e <kmem_cache_free+0x1a5>
    else 
        list_add(&(cachep->slabs_partial), &(slab->slab_link));
c0105ec4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105ec7:	83 c0 1c             	add    $0x1c,%eax
c0105eca:	8b 55 08             	mov    0x8(%ebp),%edx
c0105ecd:	83 c2 08             	add    $0x8,%edx
c0105ed0:	89 55 b0             	mov    %edx,-0x50(%ebp)
c0105ed3:	89 45 ac             	mov    %eax,-0x54(%ebp)
c0105ed6:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0105ed9:	89 45 a8             	mov    %eax,-0x58(%ebp)
c0105edc:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0105edf:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    __list_add(elm, listelm, listelm->next);
c0105ee2:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0105ee5:	8b 40 04             	mov    0x4(%eax),%eax
c0105ee8:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0105eeb:	89 55 a0             	mov    %edx,-0x60(%ebp)
c0105eee:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0105ef1:	89 55 9c             	mov    %edx,-0x64(%ebp)
c0105ef4:	89 45 98             	mov    %eax,-0x68(%ebp)
    prev->next = next->prev = elm;
c0105ef7:	8b 45 98             	mov    -0x68(%ebp),%eax
c0105efa:	8b 55 a0             	mov    -0x60(%ebp),%edx
c0105efd:	89 10                	mov    %edx,(%eax)
c0105eff:	8b 45 98             	mov    -0x68(%ebp),%eax
c0105f02:	8b 10                	mov    (%eax),%edx
c0105f04:	8b 45 9c             	mov    -0x64(%ebp),%eax
c0105f07:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0105f0a:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0105f0d:	8b 55 98             	mov    -0x68(%ebp),%edx
c0105f10:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0105f13:	8b 45 a0             	mov    -0x60(%ebp),%eax
c0105f16:	8b 55 9c             	mov    -0x64(%ebp),%edx
c0105f19:	89 10                	mov    %edx,(%eax)
}
c0105f1b:	90                   	nop
}
c0105f1c:	90                   	nop
}
c0105f1d:	90                   	nop
}
c0105f1e:	90                   	nop
c0105f1f:	c9                   	leave  
c0105f20:	c3                   	ret    

c0105f21 <kmem_cache_size>:

size_t kmem_cache_size(struct kmem_cache_t *cachep) 
{
c0105f21:	f3 0f 1e fb          	endbr32 
c0105f25:	55                   	push   %ebp
c0105f26:	89 e5                	mov    %esp,%ebp
    return cachep->objsize;
c0105f28:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f2b:	0f b7 40 18          	movzwl 0x18(%eax),%eax
}
c0105f2f:	5d                   	pop    %ebp
c0105f30:	c3                   	ret    

c0105f31 <kmem_cache_name>:

// kmem_cache_name - get cache name
const char * kmem_cache_name(struct kmem_cache_t *cachep) 
{
c0105f31:	f3 0f 1e fb          	endbr32 
c0105f35:	55                   	push   %ebp
c0105f36:	89 e5                	mov    %esp,%ebp
    return cachep->name;
c0105f38:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f3b:	83 c0 24             	add    $0x24,%eax
}
c0105f3e:	5d                   	pop    %ebp
c0105f3f:	c3                   	ret    

c0105f40 <kmem_cache_shrink>:

int kmem_cache_shrink(struct kmem_cache_t *cachep) 
{
c0105f40:	f3 0f 1e fb          	endbr32 
c0105f44:	55                   	push   %ebp
c0105f45:	89 e5                	mov    %esp,%ebp
c0105f47:	83 ec 38             	sub    $0x38,%esp
    int count = 0;
c0105f4a:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = list_next(&(cachep->slabs_free));
c0105f51:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f54:	83 c0 10             	add    $0x10,%eax
c0105f57:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return listelm->next;
c0105f5a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0105f5d:	8b 40 04             	mov    0x4(%eax),%eax
c0105f60:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &(cachep->slabs_free)) {
c0105f63:	eb 2d                	jmp    c0105f92 <kmem_cache_shrink+0x52>
        list_entry_t *temp = le;
c0105f65:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105f68:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105f6b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105f6e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0105f71:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0105f74:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c0105f77:	89 45 f0             	mov    %eax,-0x10(%ebp)
        kmem_slab_destroy(cachep, le2page(temp, slab_link));
c0105f7a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105f7d:	83 e8 1c             	sub    $0x1c,%eax
c0105f80:	89 44 24 04          	mov    %eax,0x4(%esp)
c0105f84:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f87:	89 04 24             	mov    %eax,(%esp)
c0105f8a:	e8 d3 f8 ff ff       	call   c0105862 <kmem_slab_destroy>
        count ++;
c0105f8f:	ff 45 f4             	incl   -0xc(%ebp)
    while (le != &(cachep->slabs_free)) {
c0105f92:	8b 45 08             	mov    0x8(%ebp),%eax
c0105f95:	83 c0 10             	add    $0x10,%eax
c0105f98:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0105f9b:	75 c8                	jne    c0105f65 <kmem_cache_shrink+0x25>
    }
    return count;
c0105f9d:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105fa0:	c9                   	leave  
c0105fa1:	c3                   	ret    

c0105fa2 <kmem_cache_reap>:

int kmem_cache_reap() 
{
c0105fa2:	f3 0f 1e fb          	endbr32 
c0105fa6:	55                   	push   %ebp
c0105fa7:	89 e5                	mov    %esp,%ebp
c0105fa9:	83 ec 28             	sub    $0x28,%esp
    int count = 0;
c0105fac:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = &(cache_chain);
c0105fb3:	c7 45 f0 20 6f 12 c0 	movl   $0xc0126f20,-0x10(%ebp)
    while ((le = list_next(le)) != &(cache_chain))
c0105fba:	eb 11                	jmp    c0105fcd <kmem_cache_reap+0x2b>
        count += kmem_cache_shrink(to_struct(le, struct kmem_cache_t, cache_link));
c0105fbc:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105fbf:	83 e8 34             	sub    $0x34,%eax
c0105fc2:	89 04 24             	mov    %eax,(%esp)
c0105fc5:	e8 76 ff ff ff       	call   c0105f40 <kmem_cache_shrink>
c0105fca:	01 45 f4             	add    %eax,-0xc(%ebp)
c0105fcd:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0105fd0:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0105fd3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0105fd6:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &(cache_chain))
c0105fd9:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0105fdc:	81 7d f0 20 6f 12 c0 	cmpl   $0xc0126f20,-0x10(%ebp)
c0105fe3:	75 d7                	jne    c0105fbc <kmem_cache_reap+0x1a>
    return count;
c0105fe5:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0105fe8:	c9                   	leave  
c0105fe9:	c3                   	ret    

c0105fea <kmalloc>:


void * kmalloc(size_t size) 
{
c0105fea:	f3 0f 1e fb          	endbr32 
c0105fee:	55                   	push   %ebp
c0105fef:	89 e5                	mov    %esp,%ebp
c0105ff1:	83 ec 18             	sub    $0x18,%esp
    assert(size <= SIZED_CACHE_MAX);
c0105ff4:	81 7d 08 00 08 00 00 	cmpl   $0x800,0x8(%ebp)
c0105ffb:	76 24                	jbe    c0106021 <kmalloc+0x37>
c0105ffd:	c7 44 24 0c bb a4 10 	movl   $0xc010a4bb,0xc(%esp)
c0106004:	c0 
c0106005:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c010600c:	c0 
c010600d:	c7 44 24 04 e7 00 00 	movl   $0xe7,0x4(%esp)
c0106014:	00 
c0106015:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c010601c:	e8 00 a4 ff ff       	call   c0100421 <__panic>
    return kmem_cache_alloc(sized_caches[kmem_sized_index(size)]);
c0106021:	8b 45 08             	mov    0x8(%ebp),%eax
c0106024:	89 04 24             	mov    %eax,(%esp)
c0106027:	e8 ad f5 ff ff       	call   c01055d9 <kmem_sized_index>
c010602c:	8b 04 85 80 6f 12 c0 	mov    -0x3fed9080(,%eax,4),%eax
c0106033:	89 04 24             	mov    %eax,(%esp)
c0106036:	e8 4c fb ff ff       	call   c0105b87 <kmem_cache_alloc>
}
c010603b:	c9                   	leave  
c010603c:	c3                   	ret    

c010603d <kmem_cache_zalloc>:
void * kmem_cache_zalloc(struct kmem_cache_t *cachep) 
{
c010603d:	f3 0f 1e fb          	endbr32 
c0106041:	55                   	push   %ebp
c0106042:	89 e5                	mov    %esp,%ebp
c0106044:	83 ec 28             	sub    $0x28,%esp
    void *objp = kmem_cache_alloc(cachep);
c0106047:	8b 45 08             	mov    0x8(%ebp),%eax
c010604a:	89 04 24             	mov    %eax,(%esp)
c010604d:	e8 35 fb ff ff       	call   c0105b87 <kmem_cache_alloc>
c0106052:	89 45 f4             	mov    %eax,-0xc(%ebp)
    memset(objp, 0, cachep->objsize);
c0106055:	8b 45 08             	mov    0x8(%ebp),%eax
c0106058:	0f b7 40 18          	movzwl 0x18(%eax),%eax
c010605c:	89 44 24 08          	mov    %eax,0x8(%esp)
c0106060:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0106067:	00 
c0106068:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010606b:	89 04 24             	mov    %eax,(%esp)
c010606e:	e8 6b 2c 00 00       	call   c0108cde <memset>
    return objp;
c0106073:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0106076:	c9                   	leave  
c0106077:	c3                   	ret    

c0106078 <kfree>:
void kfree(void *objp) 
{
c0106078:	f3 0f 1e fb          	endbr32 
c010607c:	55                   	push   %ebp
c010607d:	89 e5                	mov    %esp,%ebp
c010607f:	83 ec 28             	sub    $0x28,%esp
    void *base = page2kva(pages);
c0106082:	a1 08 da 2a c0       	mov    0xc02ada08,%eax
c0106087:	89 04 24             	mov    %eax,(%esp)
c010608a:	e8 f6 f4 ff ff       	call   c0105585 <page2kva>
c010608f:	89 45 f4             	mov    %eax,-0xc(%ebp)
    void *kva = ROUNDDOWN(objp, PGSIZE);
c0106092:	8b 45 08             	mov    0x8(%ebp),%eax
c0106095:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106098:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010609b:	25 00 f0 ff ff       	and    $0xfffff000,%eax
c01060a0:	89 45 ec             	mov    %eax,-0x14(%ebp)
    struct Page *slab = &pages[(kva-base)/PGSIZE];
c01060a3:	8b 0d 08 da 2a c0    	mov    0xc02ada08,%ecx
c01060a9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01060ac:	2b 45 f4             	sub    -0xc(%ebp),%eax
c01060af:	8d 90 ff 0f 00 00    	lea    0xfff(%eax),%edx
c01060b5:	85 c0                	test   %eax,%eax
c01060b7:	0f 48 c2             	cmovs  %edx,%eax
c01060ba:	c1 f8 0c             	sar    $0xc,%eax
c01060bd:	89 c2                	mov    %eax,%edx
c01060bf:	89 d0                	mov    %edx,%eax
c01060c1:	c1 e0 03             	shl    $0x3,%eax
c01060c4:	01 d0                	add    %edx,%eax
c01060c6:	c1 e0 02             	shl    $0x2,%eax
c01060c9:	01 c8                	add    %ecx,%eax
c01060cb:	89 45 e8             	mov    %eax,-0x18(%ebp)
    kmem_cache_free(slab->cachep, objp);
c01060ce:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01060d1:	8b 40 14             	mov    0x14(%eax),%eax
c01060d4:	8b 55 08             	mov    0x8(%ebp),%edx
c01060d7:	89 54 24 04          	mov    %edx,0x4(%esp)
c01060db:	89 04 24             	mov    %eax,(%esp)
c01060de:	e8 96 fc ff ff       	call   c0105d79 <kmem_cache_free>
}
c01060e3:	90                   	nop
c01060e4:	c9                   	leave  
c01060e5:	c3                   	ret    

c01060e6 <check_kmem>:
static void check_kmem() 
{
c01060e6:	f3 0f 1e fb          	endbr32 
c01060ea:	55                   	push   %ebp
c01060eb:	89 e5                	mov    %esp,%ebp
c01060ed:	53                   	push   %ebx
c01060ee:	83 ec 54             	sub    $0x54,%esp
    size_t fp = nr_free_pages();
c01060f1:	e8 54 dd ff ff       	call   c0103e4a <nr_free_pages>
c01060f6:	89 45 e8             	mov    %eax,-0x18(%ebp)

    // Create a cache 
    struct kmem_cache_t *cp0 = kmem_cache_create(test_object_name, sizeof(struct test_object), test_ctor, test_dtor);
c01060f9:	a1 40 3a 12 c0       	mov    0xc0123a40,%eax
c01060fe:	c7 44 24 0c 78 56 10 	movl   $0xc0105678,0xc(%esp)
c0106105:	c0 
c0106106:	c7 44 24 08 45 56 10 	movl   $0xc0105645,0x8(%esp)
c010610d:	c0 
c010610e:	c7 44 24 04 fe 07 00 	movl   $0x7fe,0x4(%esp)
c0106115:	00 
c0106116:	89 04 24             	mov    %eax,(%esp)
c0106119:	e8 0c f8 ff ff       	call   c010592a <kmem_cache_create>
c010611e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    assert(cp0 != NULL);
c0106121:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0106125:	75 24                	jne    c010614b <check_kmem+0x65>
c0106127:	c7 44 24 0c d3 a4 10 	movl   $0xc010a4d3,0xc(%esp)
c010612e:	c0 
c010612f:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106136:	c0 
c0106137:	c7 44 24 04 fd 00 00 	movl   $0xfd,0x4(%esp)
c010613e:	00 
c010613f:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106146:	e8 d6 a2 ff ff       	call   c0100421 <__panic>
    assert(kmem_cache_size(cp0) == sizeof(struct test_object));
c010614b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010614e:	89 04 24             	mov    %eax,(%esp)
c0106151:	e8 cb fd ff ff       	call   c0105f21 <kmem_cache_size>
c0106156:	3d fe 07 00 00       	cmp    $0x7fe,%eax
c010615b:	74 24                	je     c0106181 <check_kmem+0x9b>
c010615d:	c7 44 24 0c e0 a4 10 	movl   $0xc010a4e0,0xc(%esp)
c0106164:	c0 
c0106165:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c010616c:	c0 
c010616d:	c7 44 24 04 fe 00 00 	movl   $0xfe,0x4(%esp)
c0106174:	00 
c0106175:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c010617c:	e8 a0 a2 ff ff       	call   c0100421 <__panic>
    assert(strcmp(kmem_cache_name(cp0), test_object_name) == 0);
c0106181:	8b 1d 40 3a 12 c0    	mov    0xc0123a40,%ebx
c0106187:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010618a:	89 04 24             	mov    %eax,(%esp)
c010618d:	e8 9f fd ff ff       	call   c0105f31 <kmem_cache_name>
c0106192:	89 5c 24 04          	mov    %ebx,0x4(%esp)
c0106196:	89 04 24             	mov    %eax,(%esp)
c0106199:	e8 da 28 00 00       	call   c0108a78 <strcmp>
c010619e:	85 c0                	test   %eax,%eax
c01061a0:	74 24                	je     c01061c6 <check_kmem+0xe0>
c01061a2:	c7 44 24 0c 14 a5 10 	movl   $0xc010a514,0xc(%esp)
c01061a9:	c0 
c01061aa:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01061b1:	c0 
c01061b2:	c7 44 24 04 ff 00 00 	movl   $0xff,0x4(%esp)
c01061b9:	00 
c01061ba:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01061c1:	e8 5b a2 ff ff       	call   c0100421 <__panic>
    // Allocate six objects
    struct test_object *p0, *p1, *p2, *p3, *p4, *p5;
    char *p;
    assert((p0 = kmem_cache_alloc(cp0)) != NULL);
c01061c6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01061c9:	89 04 24             	mov    %eax,(%esp)
c01061cc:	e8 b6 f9 ff ff       	call   c0105b87 <kmem_cache_alloc>
c01061d1:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01061d4:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c01061d8:	75 24                	jne    c01061fe <check_kmem+0x118>
c01061da:	c7 44 24 0c 48 a5 10 	movl   $0xc010a548,0xc(%esp)
c01061e1:	c0 
c01061e2:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01061e9:	c0 
c01061ea:	c7 44 24 04 03 01 00 	movl   $0x103,0x4(%esp)
c01061f1:	00 
c01061f2:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01061f9:	e8 23 a2 ff ff       	call   c0100421 <__panic>
    assert((p1 = kmem_cache_alloc(cp0)) != NULL);
c01061fe:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106201:	89 04 24             	mov    %eax,(%esp)
c0106204:	e8 7e f9 ff ff       	call   c0105b87 <kmem_cache_alloc>
c0106209:	89 45 dc             	mov    %eax,-0x24(%ebp)
c010620c:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c0106210:	75 24                	jne    c0106236 <check_kmem+0x150>
c0106212:	c7 44 24 0c 70 a5 10 	movl   $0xc010a570,0xc(%esp)
c0106219:	c0 
c010621a:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106221:	c0 
c0106222:	c7 44 24 04 04 01 00 	movl   $0x104,0x4(%esp)
c0106229:	00 
c010622a:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106231:	e8 eb a1 ff ff       	call   c0100421 <__panic>
    assert((p2 = kmem_cache_alloc(cp0)) != NULL);
c0106236:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106239:	89 04 24             	mov    %eax,(%esp)
c010623c:	e8 46 f9 ff ff       	call   c0105b87 <kmem_cache_alloc>
c0106241:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0106244:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
c0106248:	75 24                	jne    c010626e <check_kmem+0x188>
c010624a:	c7 44 24 0c 98 a5 10 	movl   $0xc010a598,0xc(%esp)
c0106251:	c0 
c0106252:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106259:	c0 
c010625a:	c7 44 24 04 05 01 00 	movl   $0x105,0x4(%esp)
c0106261:	00 
c0106262:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106269:	e8 b3 a1 ff ff       	call   c0100421 <__panic>
    assert((p3 = kmem_cache_alloc(cp0)) != NULL);
c010626e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106271:	89 04 24             	mov    %eax,(%esp)
c0106274:	e8 0e f9 ff ff       	call   c0105b87 <kmem_cache_alloc>
c0106279:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c010627c:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
c0106280:	75 24                	jne    c01062a6 <check_kmem+0x1c0>
c0106282:	c7 44 24 0c c0 a5 10 	movl   $0xc010a5c0,0xc(%esp)
c0106289:	c0 
c010628a:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106291:	c0 
c0106292:	c7 44 24 04 06 01 00 	movl   $0x106,0x4(%esp)
c0106299:	00 
c010629a:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01062a1:	e8 7b a1 ff ff       	call   c0100421 <__panic>
    assert((p4 = kmem_cache_alloc(cp0)) != NULL);
c01062a6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01062a9:	89 04 24             	mov    %eax,(%esp)
c01062ac:	e8 d6 f8 ff ff       	call   c0105b87 <kmem_cache_alloc>
c01062b1:	89 45 d0             	mov    %eax,-0x30(%ebp)
c01062b4:	83 7d d0 00          	cmpl   $0x0,-0x30(%ebp)
c01062b8:	75 24                	jne    c01062de <check_kmem+0x1f8>
c01062ba:	c7 44 24 0c e8 a5 10 	movl   $0xc010a5e8,0xc(%esp)
c01062c1:	c0 
c01062c2:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01062c9:	c0 
c01062ca:	c7 44 24 04 07 01 00 	movl   $0x107,0x4(%esp)
c01062d1:	00 
c01062d2:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01062d9:	e8 43 a1 ff ff       	call   c0100421 <__panic>
    p = (char *) p4;
c01062de:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01062e1:	89 45 cc             	mov    %eax,-0x34(%ebp)
    for (int i = 0; i < sizeof(struct test_object); i++)
c01062e4:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01062eb:	eb 36                	jmp    c0106323 <check_kmem+0x23d>
        assert(p[i] == TEST_OBJECT_CTVAL);
c01062ed:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01062f0:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01062f3:	01 d0                	add    %edx,%eax
c01062f5:	0f b6 00             	movzbl (%eax),%eax
c01062f8:	3c 22                	cmp    $0x22,%al
c01062fa:	74 24                	je     c0106320 <check_kmem+0x23a>
c01062fc:	c7 44 24 0c 0d a6 10 	movl   $0xc010a60d,0xc(%esp)
c0106303:	c0 
c0106304:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c010630b:	c0 
c010630c:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
c0106313:	00 
c0106314:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c010631b:	e8 01 a1 ff ff       	call   c0100421 <__panic>
    for (int i = 0; i < sizeof(struct test_object); i++)
c0106320:	ff 45 f4             	incl   -0xc(%ebp)
c0106323:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106326:	3d fd 07 00 00       	cmp    $0x7fd,%eax
c010632b:	76 c0                	jbe    c01062ed <check_kmem+0x207>
    assert((p5 = kmem_cache_zalloc(cp0)) != NULL);
c010632d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106330:	89 04 24             	mov    %eax,(%esp)
c0106333:	e8 05 fd ff ff       	call   c010603d <kmem_cache_zalloc>
c0106338:	89 45 c8             	mov    %eax,-0x38(%ebp)
c010633b:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
c010633f:	75 24                	jne    c0106365 <check_kmem+0x27f>
c0106341:	c7 44 24 0c 28 a6 10 	movl   $0xc010a628,0xc(%esp)
c0106348:	c0 
c0106349:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106350:	c0 
c0106351:	c7 44 24 04 0b 01 00 	movl   $0x10b,0x4(%esp)
c0106358:	00 
c0106359:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106360:	e8 bc a0 ff ff       	call   c0100421 <__panic>
    p = (char *) p5;
c0106365:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0106368:	89 45 cc             	mov    %eax,-0x34(%ebp)
    for (int i = 0; i < sizeof(struct test_object); i++)
c010636b:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c0106372:	eb 36                	jmp    c01063aa <check_kmem+0x2c4>
        assert(p[i] == 0);
c0106374:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0106377:	8b 45 cc             	mov    -0x34(%ebp),%eax
c010637a:	01 d0                	add    %edx,%eax
c010637c:	0f b6 00             	movzbl (%eax),%eax
c010637f:	84 c0                	test   %al,%al
c0106381:	74 24                	je     c01063a7 <check_kmem+0x2c1>
c0106383:	c7 44 24 0c 4e a6 10 	movl   $0xc010a64e,0xc(%esp)
c010638a:	c0 
c010638b:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106392:	c0 
c0106393:	c7 44 24 04 0e 01 00 	movl   $0x10e,0x4(%esp)
c010639a:	00 
c010639b:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01063a2:	e8 7a a0 ff ff       	call   c0100421 <__panic>
    for (int i = 0; i < sizeof(struct test_object); i++)
c01063a7:	ff 45 f0             	incl   -0x10(%ebp)
c01063aa:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01063ad:	3d fd 07 00 00       	cmp    $0x7fd,%eax
c01063b2:	76 c0                	jbe    c0106374 <check_kmem+0x28e>
    assert(nr_free_pages()+3 == fp);
c01063b4:	e8 91 da ff ff       	call   c0103e4a <nr_free_pages>
c01063b9:	83 c0 03             	add    $0x3,%eax
c01063bc:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c01063bf:	74 24                	je     c01063e5 <check_kmem+0x2ff>
c01063c1:	c7 44 24 0c 58 a6 10 	movl   $0xc010a658,0xc(%esp)
c01063c8:	c0 
c01063c9:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01063d0:	c0 
c01063d1:	c7 44 24 04 0f 01 00 	movl   $0x10f,0x4(%esp)
c01063d8:	00 
c01063d9:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01063e0:	e8 3c a0 ff ff       	call   c0100421 <__panic>
    assert(list_empty(&(cp0->slabs_free)));
c01063e5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01063e8:	83 c0 10             	add    $0x10,%eax
c01063eb:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return list->next == list;
c01063ee:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01063f1:	8b 40 04             	mov    0x4(%eax),%eax
c01063f4:	39 45 c4             	cmp    %eax,-0x3c(%ebp)
c01063f7:	0f 94 c0             	sete   %al
c01063fa:	0f b6 c0             	movzbl %al,%eax
c01063fd:	85 c0                	test   %eax,%eax
c01063ff:	75 24                	jne    c0106425 <check_kmem+0x33f>
c0106401:	c7 44 24 0c 70 a6 10 	movl   $0xc010a670,0xc(%esp)
c0106408:	c0 
c0106409:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106410:	c0 
c0106411:	c7 44 24 04 10 01 00 	movl   $0x110,0x4(%esp)
c0106418:	00 
c0106419:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106420:	e8 fc 9f ff ff       	call   c0100421 <__panic>
    assert(list_empty(&(cp0->slabs_partial)));
c0106425:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106428:	83 c0 08             	add    $0x8,%eax
c010642b:	89 45 c0             	mov    %eax,-0x40(%ebp)
c010642e:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0106431:	8b 40 04             	mov    0x4(%eax),%eax
c0106434:	39 45 c0             	cmp    %eax,-0x40(%ebp)
c0106437:	0f 94 c0             	sete   %al
c010643a:	0f b6 c0             	movzbl %al,%eax
c010643d:	85 c0                	test   %eax,%eax
c010643f:	75 24                	jne    c0106465 <check_kmem+0x37f>
c0106441:	c7 44 24 0c 90 a6 10 	movl   $0xc010a690,0xc(%esp)
c0106448:	c0 
c0106449:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106450:	c0 
c0106451:	c7 44 24 04 11 01 00 	movl   $0x111,0x4(%esp)
c0106458:	00 
c0106459:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106460:	e8 bc 9f ff ff       	call   c0100421 <__panic>
    assert(list_length(&(cp0->slabs_full)) == 3);
c0106465:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106468:	89 04 24             	mov    %eax,(%esp)
c010646b:	e8 3b f2 ff ff       	call   c01056ab <list_length>
c0106470:	83 f8 03             	cmp    $0x3,%eax
c0106473:	74 24                	je     c0106499 <check_kmem+0x3b3>
c0106475:	c7 44 24 0c b4 a6 10 	movl   $0xc010a6b4,0xc(%esp)
c010647c:	c0 
c010647d:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106484:	c0 
c0106485:	c7 44 24 04 12 01 00 	movl   $0x112,0x4(%esp)
c010648c:	00 
c010648d:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106494:	e8 88 9f ff ff       	call   c0100421 <__panic>
    // Free three objects 
    kmem_cache_free(cp0, p3);
c0106499:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c010649c:	89 44 24 04          	mov    %eax,0x4(%esp)
c01064a0:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01064a3:	89 04 24             	mov    %eax,(%esp)
c01064a6:	e8 ce f8 ff ff       	call   c0105d79 <kmem_cache_free>
    kmem_cache_free(cp0, p4);
c01064ab:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01064ae:	89 44 24 04          	mov    %eax,0x4(%esp)
c01064b2:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01064b5:	89 04 24             	mov    %eax,(%esp)
c01064b8:	e8 bc f8 ff ff       	call   c0105d79 <kmem_cache_free>
    kmem_cache_free(cp0, p5);
c01064bd:	8b 45 c8             	mov    -0x38(%ebp),%eax
c01064c0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01064c4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01064c7:	89 04 24             	mov    %eax,(%esp)
c01064ca:	e8 aa f8 ff ff       	call   c0105d79 <kmem_cache_free>
    assert(list_length(&(cp0->slabs_free)) == 1);
c01064cf:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01064d2:	83 c0 10             	add    $0x10,%eax
c01064d5:	89 04 24             	mov    %eax,(%esp)
c01064d8:	e8 ce f1 ff ff       	call   c01056ab <list_length>
c01064dd:	83 f8 01             	cmp    $0x1,%eax
c01064e0:	74 24                	je     c0106506 <check_kmem+0x420>
c01064e2:	c7 44 24 0c dc a6 10 	movl   $0xc010a6dc,0xc(%esp)
c01064e9:	c0 
c01064ea:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01064f1:	c0 
c01064f2:	c7 44 24 04 17 01 00 	movl   $0x117,0x4(%esp)
c01064f9:	00 
c01064fa:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106501:	e8 1b 9f ff ff       	call   c0100421 <__panic>
    assert(list_length(&(cp0->slabs_partial)) == 1);
c0106506:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106509:	83 c0 08             	add    $0x8,%eax
c010650c:	89 04 24             	mov    %eax,(%esp)
c010650f:	e8 97 f1 ff ff       	call   c01056ab <list_length>
c0106514:	83 f8 01             	cmp    $0x1,%eax
c0106517:	74 24                	je     c010653d <check_kmem+0x457>
c0106519:	c7 44 24 0c 04 a7 10 	movl   $0xc010a704,0xc(%esp)
c0106520:	c0 
c0106521:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106528:	c0 
c0106529:	c7 44 24 04 18 01 00 	movl   $0x118,0x4(%esp)
c0106530:	00 
c0106531:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106538:	e8 e4 9e ff ff       	call   c0100421 <__panic>
    assert(list_length(&(cp0->slabs_full)) == 1);
c010653d:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106540:	89 04 24             	mov    %eax,(%esp)
c0106543:	e8 63 f1 ff ff       	call   c01056ab <list_length>
c0106548:	83 f8 01             	cmp    $0x1,%eax
c010654b:	74 24                	je     c0106571 <check_kmem+0x48b>
c010654d:	c7 44 24 0c 2c a7 10 	movl   $0xc010a72c,0xc(%esp)
c0106554:	c0 
c0106555:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c010655c:	c0 
c010655d:	c7 44 24 04 19 01 00 	movl   $0x119,0x4(%esp)
c0106564:	00 
c0106565:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c010656c:	e8 b0 9e ff ff       	call   c0100421 <__panic>
    // Shrink cache 
    assert(kmem_cache_shrink(cp0) == 1);
c0106571:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106574:	89 04 24             	mov    %eax,(%esp)
c0106577:	e8 c4 f9 ff ff       	call   c0105f40 <kmem_cache_shrink>
c010657c:	83 f8 01             	cmp    $0x1,%eax
c010657f:	74 24                	je     c01065a5 <check_kmem+0x4bf>
c0106581:	c7 44 24 0c 51 a7 10 	movl   $0xc010a751,0xc(%esp)
c0106588:	c0 
c0106589:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106590:	c0 
c0106591:	c7 44 24 04 1b 01 00 	movl   $0x11b,0x4(%esp)
c0106598:	00 
c0106599:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01065a0:	e8 7c 9e ff ff       	call   c0100421 <__panic>
    assert(nr_free_pages()+2 == fp);
c01065a5:	e8 a0 d8 ff ff       	call   c0103e4a <nr_free_pages>
c01065aa:	83 c0 02             	add    $0x2,%eax
c01065ad:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c01065b0:	74 24                	je     c01065d6 <check_kmem+0x4f0>
c01065b2:	c7 44 24 0c 6d a7 10 	movl   $0xc010a76d,0xc(%esp)
c01065b9:	c0 
c01065ba:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01065c1:	c0 
c01065c2:	c7 44 24 04 1c 01 00 	movl   $0x11c,0x4(%esp)
c01065c9:	00 
c01065ca:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01065d1:	e8 4b 9e ff ff       	call   c0100421 <__panic>
    assert(list_empty(&(cp0->slabs_free)));
c01065d6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01065d9:	83 c0 10             	add    $0x10,%eax
c01065dc:	89 45 bc             	mov    %eax,-0x44(%ebp)
c01065df:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01065e2:	8b 40 04             	mov    0x4(%eax),%eax
c01065e5:	39 45 bc             	cmp    %eax,-0x44(%ebp)
c01065e8:	0f 94 c0             	sete   %al
c01065eb:	0f b6 c0             	movzbl %al,%eax
c01065ee:	85 c0                	test   %eax,%eax
c01065f0:	75 24                	jne    c0106616 <check_kmem+0x530>
c01065f2:	c7 44 24 0c 70 a6 10 	movl   $0xc010a670,0xc(%esp)
c01065f9:	c0 
c01065fa:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106601:	c0 
c0106602:	c7 44 24 04 1d 01 00 	movl   $0x11d,0x4(%esp)
c0106609:	00 
c010660a:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106611:	e8 0b 9e ff ff       	call   c0100421 <__panic>
    p = (char *) p4;
c0106616:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0106619:	89 45 cc             	mov    %eax,-0x34(%ebp)
    for (int i = 0; i < sizeof(struct test_object); i++)
c010661c:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
c0106623:	eb 36                	jmp    c010665b <check_kmem+0x575>
        assert(p[i] == TEST_OBJECT_DTVAL);
c0106625:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0106628:	8b 45 cc             	mov    -0x34(%ebp),%eax
c010662b:	01 d0                	add    %edx,%eax
c010662d:	0f b6 00             	movzbl (%eax),%eax
c0106630:	3c 11                	cmp    $0x11,%al
c0106632:	74 24                	je     c0106658 <check_kmem+0x572>
c0106634:	c7 44 24 0c 85 a7 10 	movl   $0xc010a785,0xc(%esp)
c010663b:	c0 
c010663c:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106643:	c0 
c0106644:	c7 44 24 04 20 01 00 	movl   $0x120,0x4(%esp)
c010664b:	00 
c010664c:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106653:	e8 c9 9d ff ff       	call   c0100421 <__panic>
    for (int i = 0; i < sizeof(struct test_object); i++)
c0106658:	ff 45 ec             	incl   -0x14(%ebp)
c010665b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010665e:	3d fd 07 00 00       	cmp    $0x7fd,%eax
c0106663:	76 c0                	jbe    c0106625 <check_kmem+0x53f>
    // Reap cache 
    kmem_cache_free(cp0, p0);
c0106665:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0106668:	89 44 24 04          	mov    %eax,0x4(%esp)
c010666c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c010666f:	89 04 24             	mov    %eax,(%esp)
c0106672:	e8 02 f7 ff ff       	call   c0105d79 <kmem_cache_free>
    kmem_cache_free(cp0, p1);
c0106677:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010667a:	89 44 24 04          	mov    %eax,0x4(%esp)
c010667e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106681:	89 04 24             	mov    %eax,(%esp)
c0106684:	e8 f0 f6 ff ff       	call   c0105d79 <kmem_cache_free>
    kmem_cache_free(cp0, p2);
c0106689:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010668c:	89 44 24 04          	mov    %eax,0x4(%esp)
c0106690:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106693:	89 04 24             	mov    %eax,(%esp)
c0106696:	e8 de f6 ff ff       	call   c0105d79 <kmem_cache_free>
    assert(kmem_cache_reap() == 2);
c010669b:	e8 02 f9 ff ff       	call   c0105fa2 <kmem_cache_reap>
c01066a0:	83 f8 02             	cmp    $0x2,%eax
c01066a3:	74 24                	je     c01066c9 <check_kmem+0x5e3>
c01066a5:	c7 44 24 0c 9f a7 10 	movl   $0xc010a79f,0xc(%esp)
c01066ac:	c0 
c01066ad:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01066b4:	c0 
c01066b5:	c7 44 24 04 25 01 00 	movl   $0x125,0x4(%esp)
c01066bc:	00 
c01066bd:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01066c4:	e8 58 9d ff ff       	call   c0100421 <__panic>
    assert(nr_free_pages() == fp);
c01066c9:	e8 7c d7 ff ff       	call   c0103e4a <nr_free_pages>
c01066ce:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c01066d1:	74 24                	je     c01066f7 <check_kmem+0x611>
c01066d3:	c7 44 24 0c b6 a7 10 	movl   $0xc010a7b6,0xc(%esp)
c01066da:	c0 
c01066db:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01066e2:	c0 
c01066e3:	c7 44 24 04 26 01 00 	movl   $0x126,0x4(%esp)
c01066ea:	00 
c01066eb:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01066f2:	e8 2a 9d ff ff       	call   c0100421 <__panic>
    // Destory a cache 
    kmem_cache_destroy(cp0);
c01066f7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01066fa:	89 04 24             	mov    %eax,(%esp)
c01066fd:	e8 84 f3 ff ff       	call   c0105a86 <kmem_cache_destroy>

    // Sized alloc 
    assert((p0 = kmalloc(2048)) != NULL);
c0106702:	c7 04 24 00 08 00 00 	movl   $0x800,(%esp)
c0106709:	e8 dc f8 ff ff       	call   c0105fea <kmalloc>
c010670e:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0106711:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c0106715:	75 24                	jne    c010673b <check_kmem+0x655>
c0106717:	c7 44 24 0c cc a7 10 	movl   $0xc010a7cc,0xc(%esp)
c010671e:	c0 
c010671f:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106726:	c0 
c0106727:	c7 44 24 04 2b 01 00 	movl   $0x12b,0x4(%esp)
c010672e:	00 
c010672f:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106736:	e8 e6 9c ff ff       	call   c0100421 <__panic>
    assert(nr_free_pages()+1 == fp);
c010673b:	e8 0a d7 ff ff       	call   c0103e4a <nr_free_pages>
c0106740:	40                   	inc    %eax
c0106741:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0106744:	74 24                	je     c010676a <check_kmem+0x684>
c0106746:	c7 44 24 0c e9 a7 10 	movl   $0xc010a7e9,0xc(%esp)
c010674d:	c0 
c010674e:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c0106755:	c0 
c0106756:	c7 44 24 04 2c 01 00 	movl   $0x12c,0x4(%esp)
c010675d:	00 
c010675e:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c0106765:	e8 b7 9c ff ff       	call   c0100421 <__panic>
    kfree(p0);
c010676a:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010676d:	89 04 24             	mov    %eax,(%esp)
c0106770:	e8 03 f9 ff ff       	call   c0106078 <kfree>
    assert(kmem_cache_reap() == 1);
c0106775:	e8 28 f8 ff ff       	call   c0105fa2 <kmem_cache_reap>
c010677a:	83 f8 01             	cmp    $0x1,%eax
c010677d:	74 24                	je     c01067a3 <check_kmem+0x6bd>
c010677f:	c7 44 24 0c 01 a8 10 	movl   $0xc010a801,0xc(%esp)
c0106786:	c0 
c0106787:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c010678e:	c0 
c010678f:	c7 44 24 04 2e 01 00 	movl   $0x12e,0x4(%esp)
c0106796:	00 
c0106797:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c010679e:	e8 7e 9c ff ff       	call   c0100421 <__panic>
    assert(nr_free_pages() == fp);
c01067a3:	e8 a2 d6 ff ff       	call   c0103e4a <nr_free_pages>
c01067a8:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c01067ab:	74 24                	je     c01067d1 <check_kmem+0x6eb>
c01067ad:	c7 44 24 0c b6 a7 10 	movl   $0xc010a7b6,0xc(%esp)
c01067b4:	c0 
c01067b5:	c7 44 24 08 97 a4 10 	movl   $0xc010a497,0x8(%esp)
c01067bc:	c0 
c01067bd:	c7 44 24 04 2f 01 00 	movl   $0x12f,0x4(%esp)
c01067c4:	00 
c01067c5:	c7 04 24 ac a4 10 c0 	movl   $0xc010a4ac,(%esp)
c01067cc:	e8 50 9c ff ff       	call   c0100421 <__panic>

    cprintf("check_kmem() succeeded!\n");
c01067d1:	c7 04 24 18 a8 10 c0 	movl   $0xc010a818,(%esp)
c01067d8:	e8 d8 9a ff ff       	call   c01002b5 <cprintf>

}
c01067dd:	90                   	nop
c01067de:	83 c4 54             	add    $0x54,%esp
c01067e1:	5b                   	pop    %ebx
c01067e2:	5d                   	pop    %ebp
c01067e3:	c3                   	ret    

c01067e4 <kmem_int>:
void kmem_int() 
{
c01067e4:	f3 0f 1e fb          	endbr32 
c01067e8:	55                   	push   %ebp
c01067e9:	89 e5                	mov    %esp,%ebp
c01067eb:	83 ec 58             	sub    $0x58,%esp

    // Init cache for kmem_cache
    cache_cache.objsize = sizeof(struct kmem_cache_t);
c01067ee:	66 c7 05 58 6f 12 c0 	movw   $0x3c,0xc0126f58
c01067f5:	3c 00 
    cache_cache.num = PGSIZE / (sizeof(int16_t) + sizeof(struct kmem_cache_t));
c01067f7:	66 c7 05 5a 6f 12 c0 	movw   $0x42,0xc0126f5a
c01067fe:	42 00 
    cache_cache.ctor = NULL;
c0106800:	c7 05 5c 6f 12 c0 00 	movl   $0x0,0xc0126f5c
c0106807:	00 00 00 
    cache_cache.dtor = NULL;
c010680a:	c7 05 60 6f 12 c0 00 	movl   $0x0,0xc0126f60
c0106811:	00 00 00 
    memcpy(cache_cache.name, cache_cache_name, CACHE_NAMELEN);
c0106814:	a1 38 3a 12 c0       	mov    0xc0123a38,%eax
c0106819:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
c0106820:	00 
c0106821:	89 44 24 04          	mov    %eax,0x4(%esp)
c0106825:	c7 04 24 64 6f 12 c0 	movl   $0xc0126f64,(%esp)
c010682c:	e8 97 25 00 00       	call   c0108dc8 <memcpy>
c0106831:	c7 45 c4 40 6f 12 c0 	movl   $0xc0126f40,-0x3c(%ebp)
    elm->prev = elm->next = elm;
c0106838:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010683b:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c010683e:	89 50 04             	mov    %edx,0x4(%eax)
c0106841:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0106844:	8b 50 04             	mov    0x4(%eax),%edx
c0106847:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010684a:	89 10                	mov    %edx,(%eax)
}
c010684c:	90                   	nop
c010684d:	c7 45 c8 48 6f 12 c0 	movl   $0xc0126f48,-0x38(%ebp)
    elm->prev = elm->next = elm;
c0106854:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0106857:	8b 55 c8             	mov    -0x38(%ebp),%edx
c010685a:	89 50 04             	mov    %edx,0x4(%eax)
c010685d:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0106860:	8b 50 04             	mov    0x4(%eax),%edx
c0106863:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0106866:	89 10                	mov    %edx,(%eax)
}
c0106868:	90                   	nop
c0106869:	c7 45 cc 50 6f 12 c0 	movl   $0xc0126f50,-0x34(%ebp)
    elm->prev = elm->next = elm;
c0106870:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0106873:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0106876:	89 50 04             	mov    %edx,0x4(%eax)
c0106879:	8b 45 cc             	mov    -0x34(%ebp),%eax
c010687c:	8b 50 04             	mov    0x4(%eax),%edx
c010687f:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0106882:	89 10                	mov    %edx,(%eax)
}
c0106884:	90                   	nop
c0106885:	c7 45 d0 20 6f 12 c0 	movl   $0xc0126f20,-0x30(%ebp)
    elm->prev = elm->next = elm;
c010688c:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010688f:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0106892:	89 50 04             	mov    %edx,0x4(%eax)
c0106895:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0106898:	8b 50 04             	mov    0x4(%eax),%edx
c010689b:	8b 45 d0             	mov    -0x30(%ebp),%eax
c010689e:	89 10                	mov    %edx,(%eax)
}
c01068a0:	90                   	nop
c01068a1:	c7 45 ec 20 6f 12 c0 	movl   $0xc0126f20,-0x14(%ebp)
c01068a8:	c7 45 e8 74 6f 12 c0 	movl   $0xc0126f74,-0x18(%ebp)
c01068af:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01068b2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01068b5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01068b8:	89 45 e0             	mov    %eax,-0x20(%ebp)
    __list_add(elm, listelm, listelm->next);
c01068bb:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01068be:	8b 40 04             	mov    0x4(%eax),%eax
c01068c1:	8b 55 e0             	mov    -0x20(%ebp),%edx
c01068c4:	89 55 dc             	mov    %edx,-0x24(%ebp)
c01068c7:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01068ca:	89 55 d8             	mov    %edx,-0x28(%ebp)
c01068cd:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    prev->next = next->prev = elm;
c01068d0:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01068d3:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01068d6:	89 10                	mov    %edx,(%eax)
c01068d8:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01068db:	8b 10                	mov    (%eax),%edx
c01068dd:	8b 45 d8             	mov    -0x28(%ebp),%eax
c01068e0:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c01068e3:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01068e6:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01068e9:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c01068ec:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01068ef:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01068f2:	89 10                	mov    %edx,(%eax)
}
c01068f4:	90                   	nop
}
c01068f5:	90                   	nop
}
c01068f6:	90                   	nop
    list_init(&(cache_cache.slabs_free));
    list_init(&(cache_chain));
    list_add(&(cache_chain), &(cache_cache.cache_link));

    // Init sized cache 
    for (int i = 0, size = 16; i < SIZED_CACHE_NUM; i++, size *= 2)
c01068f7:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c01068fe:	c7 45 f0 10 00 00 00 	movl   $0x10,-0x10(%ebp)
c0106905:	eb 34                	jmp    c010693b <kmem_int+0x157>
        sized_caches[i] = kmem_cache_create(sized_cache_name, size, NULL, NULL); 
c0106907:	8b 55 f0             	mov    -0x10(%ebp),%edx
c010690a:	a1 3c 3a 12 c0       	mov    0xc0123a3c,%eax
c010690f:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
c0106916:	00 
c0106917:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
c010691e:	00 
c010691f:	89 54 24 04          	mov    %edx,0x4(%esp)
c0106923:	89 04 24             	mov    %eax,(%esp)
c0106926:	e8 ff ef ff ff       	call   c010592a <kmem_cache_create>
c010692b:	8b 55 f4             	mov    -0xc(%ebp),%edx
c010692e:	89 04 95 80 6f 12 c0 	mov    %eax,-0x3fed9080(,%edx,4)
    for (int i = 0, size = 16; i < SIZED_CACHE_NUM; i++, size *= 2)
c0106935:	ff 45 f4             	incl   -0xc(%ebp)
c0106938:	d1 65 f0             	shll   -0x10(%ebp)
c010693b:	83 7d f4 07          	cmpl   $0x7,-0xc(%ebp)
c010693f:	7e c6                	jle    c0106907 <kmem_int+0x123>

    check_kmem();
c0106941:	e8 a0 f7 ff ff       	call   c01060e6 <check_kmem>
}
c0106946:	90                   	nop
c0106947:	c9                   	leave  
c0106948:	c3                   	ret    

c0106949 <page2ppn>:
page2ppn(struct Page *page) {
c0106949:	55                   	push   %ebp
c010694a:	89 e5                	mov    %esp,%ebp
    return page - pages;
c010694c:	a1 08 da 2a c0       	mov    0xc02ada08,%eax
c0106951:	8b 55 08             	mov    0x8(%ebp),%edx
c0106954:	29 c2                	sub    %eax,%edx
c0106956:	89 d0                	mov    %edx,%eax
c0106958:	c1 f8 02             	sar    $0x2,%eax
c010695b:	69 c0 39 8e e3 38    	imul   $0x38e38e39,%eax,%eax
}
c0106961:	5d                   	pop    %ebp
c0106962:	c3                   	ret    

c0106963 <page2pa>:
page2pa(struct Page *page) {
c0106963:	55                   	push   %ebp
c0106964:	89 e5                	mov    %esp,%ebp
c0106966:	83 ec 04             	sub    $0x4,%esp
    return page2ppn(page) << PGSHIFT;
c0106969:	8b 45 08             	mov    0x8(%ebp),%eax
c010696c:	89 04 24             	mov    %eax,(%esp)
c010696f:	e8 d5 ff ff ff       	call   c0106949 <page2ppn>
c0106974:	c1 e0 0c             	shl    $0xc,%eax
}
c0106977:	c9                   	leave  
c0106978:	c3                   	ret    

c0106979 <page_ref>:
page_ref(struct Page *page) {
c0106979:	55                   	push   %ebp
c010697a:	89 e5                	mov    %esp,%ebp
    return page->ref;
c010697c:	8b 45 08             	mov    0x8(%ebp),%eax
c010697f:	8b 00                	mov    (%eax),%eax
}
c0106981:	5d                   	pop    %ebp
c0106982:	c3                   	ret    

c0106983 <set_page_ref>:
set_page_ref(struct Page *page, int val) {
c0106983:	55                   	push   %ebp
c0106984:	89 e5                	mov    %esp,%ebp
    page->ref = val;
c0106986:	8b 45 08             	mov    0x8(%ebp),%eax
c0106989:	8b 55 0c             	mov    0xc(%ebp),%edx
c010698c:	89 10                	mov    %edx,(%eax)
}
c010698e:	90                   	nop
c010698f:	5d                   	pop    %ebp
c0106990:	c3                   	ret    

c0106991 <default_init>:

#define free_list (free_area.free_list)
#define nr_free (free_area.nr_free)

static void
default_init(void) {
c0106991:	f3 0f 1e fb          	endbr32 
c0106995:	55                   	push   %ebp
c0106996:	89 e5                	mov    %esp,%ebp
c0106998:	83 ec 10             	sub    $0x10,%esp
c010699b:	c7 45 fc e0 33 1c c0 	movl   $0xc01c33e0,-0x4(%ebp)
    elm->prev = elm->next = elm;
c01069a2:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01069a5:	8b 55 fc             	mov    -0x4(%ebp),%edx
c01069a8:	89 50 04             	mov    %edx,0x4(%eax)
c01069ab:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01069ae:	8b 50 04             	mov    0x4(%eax),%edx
c01069b1:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01069b4:	89 10                	mov    %edx,(%eax)
}
c01069b6:	90                   	nop
    list_init(&free_list);
    nr_free = 0;
c01069b7:	c7 05 e8 33 1c c0 00 	movl   $0x0,0xc01c33e8
c01069be:	00 00 00 
}
c01069c1:	90                   	nop
c01069c2:	c9                   	leave  
c01069c3:	c3                   	ret    

c01069c4 <default_init_memmap>:

static void
default_init_memmap(struct Page *base, size_t n) {
c01069c4:	f3 0f 1e fb          	endbr32 
c01069c8:	55                   	push   %ebp
c01069c9:	89 e5                	mov    %esp,%ebp
c01069cb:	83 ec 58             	sub    $0x58,%esp
    assert(n > 0);
c01069ce:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c01069d2:	75 24                	jne    c01069f8 <default_init_memmap+0x34>
c01069d4:	c7 44 24 0c 34 a8 10 	movl   $0xc010a834,0xc(%esp)
c01069db:	c0 
c01069dc:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01069e3:	c0 
c01069e4:	c7 44 24 04 6d 00 00 	movl   $0x6d,0x4(%esp)
c01069eb:	00 
c01069ec:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01069f3:	e8 29 9a ff ff       	call   c0100421 <__panic>
    struct Page *p = base;
c01069f8:	8b 45 08             	mov    0x8(%ebp),%eax
c01069fb:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
c01069fe:	eb 7d                	jmp    c0106a7d <default_init_memmap+0xb9>
        assert(PageReserved(p));
c0106a00:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106a03:	83 c0 04             	add    $0x4,%eax
c0106a06:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
c0106a0d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0106a10:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106a13:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0106a16:	0f a3 10             	bt     %edx,(%eax)
c0106a19:	19 c0                	sbb    %eax,%eax
c0106a1b:	89 45 e8             	mov    %eax,-0x18(%ebp)
    return oldbit != 0;
c0106a1e:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0106a22:	0f 95 c0             	setne  %al
c0106a25:	0f b6 c0             	movzbl %al,%eax
c0106a28:	85 c0                	test   %eax,%eax
c0106a2a:	75 24                	jne    c0106a50 <default_init_memmap+0x8c>
c0106a2c:	c7 44 24 0c 65 a8 10 	movl   $0xc010a865,0xc(%esp)
c0106a33:	c0 
c0106a34:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0106a3b:	c0 
c0106a3c:	c7 44 24 04 70 00 00 	movl   $0x70,0x4(%esp)
c0106a43:	00 
c0106a44:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0106a4b:	e8 d1 99 ff ff       	call   c0100421 <__panic>
        p->flags = p->property = 0;
c0106a50:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106a53:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
c0106a5a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106a5d:	8b 50 08             	mov    0x8(%eax),%edx
c0106a60:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106a63:	89 50 04             	mov    %edx,0x4(%eax)
        set_page_ref(p, 0);
c0106a66:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0106a6d:	00 
c0106a6e:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106a71:	89 04 24             	mov    %eax,(%esp)
c0106a74:	e8 0a ff ff ff       	call   c0106983 <set_page_ref>
    for (; p != base + n; p ++) {
c0106a79:	83 45 f4 24          	addl   $0x24,-0xc(%ebp)
c0106a7d:	8b 55 0c             	mov    0xc(%ebp),%edx
c0106a80:	89 d0                	mov    %edx,%eax
c0106a82:	c1 e0 03             	shl    $0x3,%eax
c0106a85:	01 d0                	add    %edx,%eax
c0106a87:	c1 e0 02             	shl    $0x2,%eax
c0106a8a:	89 c2                	mov    %eax,%edx
c0106a8c:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a8f:	01 d0                	add    %edx,%eax
c0106a91:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0106a94:	0f 85 66 ff ff ff    	jne    c0106a00 <default_init_memmap+0x3c>
    }
    base->property = n;
c0106a9a:	8b 45 08             	mov    0x8(%ebp),%eax
c0106a9d:	8b 55 0c             	mov    0xc(%ebp),%edx
c0106aa0:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);
c0106aa3:	8b 45 08             	mov    0x8(%ebp),%eax
c0106aa6:	83 c0 04             	add    $0x4,%eax
c0106aa9:	c7 45 c8 01 00 00 00 	movl   $0x1,-0x38(%ebp)
c0106ab0:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0106ab3:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0106ab6:	8b 55 c8             	mov    -0x38(%ebp),%edx
c0106ab9:	0f ab 10             	bts    %edx,(%eax)
}
c0106abc:	90                   	nop
    nr_free += n;
c0106abd:	8b 15 e8 33 1c c0    	mov    0xc01c33e8,%edx
c0106ac3:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106ac6:	01 d0                	add    %edx,%eax
c0106ac8:	a3 e8 33 1c c0       	mov    %eax,0xc01c33e8
    list_add(&free_list, &(base->page_link));
c0106acd:	8b 45 08             	mov    0x8(%ebp),%eax
c0106ad0:	83 c0 0c             	add    $0xc,%eax
c0106ad3:	c7 45 e4 e0 33 1c c0 	movl   $0xc01c33e0,-0x1c(%ebp)
c0106ada:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0106add:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106ae0:	89 45 dc             	mov    %eax,-0x24(%ebp)
c0106ae3:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0106ae6:	89 45 d8             	mov    %eax,-0x28(%ebp)
    __list_add(elm, listelm, listelm->next);
c0106ae9:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0106aec:	8b 40 04             	mov    0x4(%eax),%eax
c0106aef:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0106af2:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0106af5:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106af8:	89 55 d0             	mov    %edx,-0x30(%ebp)
c0106afb:	89 45 cc             	mov    %eax,-0x34(%ebp)
    prev->next = next->prev = elm;
c0106afe:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0106b01:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0106b04:	89 10                	mov    %edx,(%eax)
c0106b06:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0106b09:	8b 10                	mov    (%eax),%edx
c0106b0b:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0106b0e:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0106b11:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0106b14:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0106b17:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0106b1a:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0106b1d:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0106b20:	89 10                	mov    %edx,(%eax)
}
c0106b22:	90                   	nop
}
c0106b23:	90                   	nop
}
c0106b24:	90                   	nop
}
c0106b25:	90                   	nop
c0106b26:	c9                   	leave  
c0106b27:	c3                   	ret    

c0106b28 <default_alloc_pages>:

static struct Page *
default_alloc_pages(size_t n) {
c0106b28:	f3 0f 1e fb          	endbr32 
c0106b2c:	55                   	push   %ebp
c0106b2d:	89 e5                	mov    %esp,%ebp
c0106b2f:	83 ec 78             	sub    $0x78,%esp
    assert(n > 0);
c0106b32:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0106b36:	75 24                	jne    c0106b5c <default_alloc_pages+0x34>
c0106b38:	c7 44 24 0c 34 a8 10 	movl   $0xc010a834,0xc(%esp)
c0106b3f:	c0 
c0106b40:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0106b47:	c0 
c0106b48:	c7 44 24 04 7c 00 00 	movl   $0x7c,0x4(%esp)
c0106b4f:	00 
c0106b50:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0106b57:	e8 c5 98 ff ff       	call   c0100421 <__panic>
    if (n > nr_free) {
c0106b5c:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
c0106b61:	39 45 08             	cmp    %eax,0x8(%ebp)
c0106b64:	76 0a                	jbe    c0106b70 <default_alloc_pages+0x48>
        return NULL;
c0106b66:	b8 00 00 00 00       	mov    $0x0,%eax
c0106b6b:	e9 78 01 00 00       	jmp    c0106ce8 <default_alloc_pages+0x1c0>
    }
    struct Page *page = NULL;
c0106b70:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    list_entry_t *le = &free_list;
c0106b77:	c7 45 f0 e0 33 1c c0 	movl   $0xc01c33e0,-0x10(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0106b7e:	eb 1c                	jmp    c0106b9c <default_alloc_pages+0x74>
        struct Page *p = le2page(le, page_link);
c0106b80:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106b83:	83 e8 0c             	sub    $0xc,%eax
c0106b86:	89 45 e8             	mov    %eax,-0x18(%ebp)
        if (p->property >= n) {
c0106b89:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0106b8c:	8b 40 08             	mov    0x8(%eax),%eax
c0106b8f:	39 45 08             	cmp    %eax,0x8(%ebp)
c0106b92:	77 08                	ja     c0106b9c <default_alloc_pages+0x74>
            page = p;
c0106b94:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0106b97:	89 45 f4             	mov    %eax,-0xc(%ebp)
            break;
c0106b9a:	eb 18                	jmp    c0106bb4 <default_alloc_pages+0x8c>
c0106b9c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106b9f:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return listelm->next;
c0106ba2:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0106ba5:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0106ba8:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0106bab:	81 7d f0 e0 33 1c c0 	cmpl   $0xc01c33e0,-0x10(%ebp)
c0106bb2:	75 cc                	jne    c0106b80 <default_alloc_pages+0x58>
        }
    }
    struct list_entry_t* it;
    if (page != NULL) {
c0106bb4:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0106bb8:	0f 84 27 01 00 00    	je     c0106ce5 <default_alloc_pages+0x1bd>
        list_del(&(page->page_link));
c0106bbe:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106bc1:	83 c0 0c             	add    $0xc,%eax
c0106bc4:	89 45 dc             	mov    %eax,-0x24(%ebp)
    __list_del(listelm->prev, listelm->next);
c0106bc7:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0106bca:	8b 40 04             	mov    0x4(%eax),%eax
c0106bcd:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106bd0:	8b 12                	mov    (%edx),%edx
c0106bd2:	89 55 d8             	mov    %edx,-0x28(%ebp)
c0106bd5:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    prev->next = next;
c0106bd8:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0106bdb:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0106bde:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0106be1:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0106be4:	8b 55 d8             	mov    -0x28(%ebp),%edx
c0106be7:	89 10                	mov    %edx,(%eax)
}
c0106be9:	90                   	nop
}
c0106bea:	90                   	nop
        if (page->property > n) {
c0106beb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106bee:	8b 40 08             	mov    0x8(%eax),%eax
c0106bf1:	39 45 08             	cmp    %eax,0x8(%ebp)
c0106bf4:	0f 83 c4 00 00 00    	jae    c0106cbe <default_alloc_pages+0x196>
            struct Page *p = page + n;
c0106bfa:	8b 55 08             	mov    0x8(%ebp),%edx
c0106bfd:	89 d0                	mov    %edx,%eax
c0106bff:	c1 e0 03             	shl    $0x3,%eax
c0106c02:	01 d0                	add    %edx,%eax
c0106c04:	c1 e0 02             	shl    $0x2,%eax
c0106c07:	89 c2                	mov    %eax,%edx
c0106c09:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106c0c:	01 d0                	add    %edx,%eax
c0106c0e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            p->property = page->property - n;
c0106c11:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106c14:	8b 40 08             	mov    0x8(%eax),%eax
c0106c17:	2b 45 08             	sub    0x8(%ebp),%eax
c0106c1a:	89 c2                	mov    %eax,%edx
c0106c1c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106c1f:	89 50 08             	mov    %edx,0x8(%eax)
c0106c22:	c7 45 d0 e0 33 1c c0 	movl   $0xc01c33e0,-0x30(%ebp)
    return listelm->next;
c0106c29:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0106c2c:	8b 40 04             	mov    0x4(%eax),%eax
            for(it=list_next(&free_list);it!=&free_list && le2page(it,page_link)->property < p->property;it=list_next(it));
c0106c2f:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0106c32:	eb 0f                	jmp    c0106c43 <default_alloc_pages+0x11b>
c0106c34:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106c37:	89 45 cc             	mov    %eax,-0x34(%ebp)
c0106c3a:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0106c3d:	8b 40 04             	mov    0x4(%eax),%eax
c0106c40:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0106c43:	81 7d ec e0 33 1c c0 	cmpl   $0xc01c33e0,-0x14(%ebp)
c0106c4a:	74 13                	je     c0106c5f <default_alloc_pages+0x137>
c0106c4c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106c4f:	83 e8 0c             	sub    $0xc,%eax
c0106c52:	8b 50 08             	mov    0x8(%eax),%edx
c0106c55:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106c58:	8b 40 08             	mov    0x8(%eax),%eax
c0106c5b:	39 c2                	cmp    %eax,%edx
c0106c5d:	72 d5                	jb     c0106c34 <default_alloc_pages+0x10c>
            list_add(list_prev(it), &(p->page_link));
c0106c5f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106c62:	8d 50 0c             	lea    0xc(%eax),%edx
c0106c65:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106c68:	89 45 ac             	mov    %eax,-0x54(%ebp)
    return listelm->prev;
c0106c6b:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0106c6e:	8b 00                	mov    (%eax),%eax
c0106c70:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0106c73:	89 55 c4             	mov    %edx,-0x3c(%ebp)
c0106c76:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0106c79:	89 45 c0             	mov    %eax,-0x40(%ebp)
c0106c7c:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0106c7f:	89 45 bc             	mov    %eax,-0x44(%ebp)
    __list_add(elm, listelm, listelm->next);
c0106c82:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0106c85:	8b 40 04             	mov    0x4(%eax),%eax
c0106c88:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0106c8b:	89 55 b8             	mov    %edx,-0x48(%ebp)
c0106c8e:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0106c91:	89 55 b4             	mov    %edx,-0x4c(%ebp)
c0106c94:	89 45 b0             	mov    %eax,-0x50(%ebp)
    prev->next = next->prev = elm;
c0106c97:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0106c9a:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0106c9d:	89 10                	mov    %edx,(%eax)
c0106c9f:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0106ca2:	8b 10                	mov    (%eax),%edx
c0106ca4:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0106ca7:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0106caa:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0106cad:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0106cb0:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0106cb3:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0106cb6:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0106cb9:	89 10                	mov    %edx,(%eax)
}
c0106cbb:	90                   	nop
}
c0106cbc:	90                   	nop
}
c0106cbd:	90                   	nop
    }
        nr_free -= n;
c0106cbe:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
c0106cc3:	2b 45 08             	sub    0x8(%ebp),%eax
c0106cc6:	a3 e8 33 1c c0       	mov    %eax,0xc01c33e8
        ClearPageProperty(page);
c0106ccb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106cce:	83 c0 04             	add    $0x4,%eax
c0106cd1:	c7 45 a8 01 00 00 00 	movl   $0x1,-0x58(%ebp)
c0106cd8:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0106cdb:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0106cde:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0106ce1:	0f b3 10             	btr    %edx,(%eax)
}
c0106ce4:	90                   	nop
    }
    return page;
c0106ce5:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0106ce8:	c9                   	leave  
c0106ce9:	c3                   	ret    

c0106cea <default_free_pages>:

static void
default_free_pages(struct Page *base, size_t n) {
c0106cea:	f3 0f 1e fb          	endbr32 
c0106cee:	55                   	push   %ebp
c0106cef:	89 e5                	mov    %esp,%ebp
c0106cf1:	81 ec a8 00 00 00    	sub    $0xa8,%esp
    assert(n > 0);
c0106cf7:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0106cfb:	75 24                	jne    c0106d21 <default_free_pages+0x37>
c0106cfd:	c7 44 24 0c 34 a8 10 	movl   $0xc010a834,0xc(%esp)
c0106d04:	c0 
c0106d05:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0106d0c:	c0 
c0106d0d:	c7 44 24 04 9a 00 00 	movl   $0x9a,0x4(%esp)
c0106d14:	00 
c0106d15:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0106d1c:	e8 00 97 ff ff       	call   c0100421 <__panic>
    struct Page *p = base;
c0106d21:	8b 45 08             	mov    0x8(%ebp),%eax
c0106d24:	89 45 f4             	mov    %eax,-0xc(%ebp)
    for (; p != base + n; p ++) {
c0106d27:	e9 9d 00 00 00       	jmp    c0106dc9 <default_free_pages+0xdf>
        assert(!PageReserved(p) && !PageProperty(p));
c0106d2c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106d2f:	83 c0 04             	add    $0x4,%eax
c0106d32:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0106d39:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0106d3c:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0106d3f:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0106d42:	0f a3 10             	bt     %edx,(%eax)
c0106d45:	19 c0                	sbb    %eax,%eax
c0106d47:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return oldbit != 0;
c0106d4a:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c0106d4e:	0f 95 c0             	setne  %al
c0106d51:	0f b6 c0             	movzbl %al,%eax
c0106d54:	85 c0                	test   %eax,%eax
c0106d56:	75 2c                	jne    c0106d84 <default_free_pages+0x9a>
c0106d58:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106d5b:	83 c0 04             	add    $0x4,%eax
c0106d5e:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
c0106d65:	89 45 d8             	mov    %eax,-0x28(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0106d68:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0106d6b:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0106d6e:	0f a3 10             	bt     %edx,(%eax)
c0106d71:	19 c0                	sbb    %eax,%eax
c0106d73:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    return oldbit != 0;
c0106d76:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
c0106d7a:	0f 95 c0             	setne  %al
c0106d7d:	0f b6 c0             	movzbl %al,%eax
c0106d80:	85 c0                	test   %eax,%eax
c0106d82:	74 24                	je     c0106da8 <default_free_pages+0xbe>
c0106d84:	c7 44 24 0c 78 a8 10 	movl   $0xc010a878,0xc(%esp)
c0106d8b:	c0 
c0106d8c:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0106d93:	c0 
c0106d94:	c7 44 24 04 9d 00 00 	movl   $0x9d,0x4(%esp)
c0106d9b:	00 
c0106d9c:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0106da3:	e8 79 96 ff ff       	call   c0100421 <__panic>
        p->flags = 0;
c0106da8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106dab:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        set_page_ref(p, 0);
c0106db2:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0106db9:	00 
c0106dba:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106dbd:	89 04 24             	mov    %eax,(%esp)
c0106dc0:	e8 be fb ff ff       	call   c0106983 <set_page_ref>
    for (; p != base + n; p ++) {
c0106dc5:	83 45 f4 24          	addl   $0x24,-0xc(%ebp)
c0106dc9:	8b 55 0c             	mov    0xc(%ebp),%edx
c0106dcc:	89 d0                	mov    %edx,%eax
c0106dce:	c1 e0 03             	shl    $0x3,%eax
c0106dd1:	01 d0                	add    %edx,%eax
c0106dd3:	c1 e0 02             	shl    $0x2,%eax
c0106dd6:	89 c2                	mov    %eax,%edx
c0106dd8:	8b 45 08             	mov    0x8(%ebp),%eax
c0106ddb:	01 d0                	add    %edx,%eax
c0106ddd:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0106de0:	0f 85 46 ff ff ff    	jne    c0106d2c <default_free_pages+0x42>
    }
    base->property = n;
c0106de6:	8b 45 08             	mov    0x8(%ebp),%eax
c0106de9:	8b 55 0c             	mov    0xc(%ebp),%edx
c0106dec:	89 50 08             	mov    %edx,0x8(%eax)
    SetPageProperty(base);
c0106def:	8b 45 08             	mov    0x8(%ebp),%eax
c0106df2:	83 c0 04             	add    $0x4,%eax
c0106df5:	c7 45 cc 01 00 00 00 	movl   $0x1,-0x34(%ebp)
c0106dfc:	89 45 c8             	mov    %eax,-0x38(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0106dff:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0106e02:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0106e05:	0f ab 10             	bts    %edx,(%eax)
}
c0106e08:	90                   	nop
c0106e09:	c7 45 d0 e0 33 1c c0 	movl   $0xc01c33e0,-0x30(%ebp)
    return listelm->next;
c0106e10:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0106e13:	8b 40 04             	mov    0x4(%eax),%eax
    list_entry_t *le = list_next(&free_list);
c0106e16:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (le != &free_list) {
c0106e19:	e9 0e 01 00 00       	jmp    c0106f2c <default_free_pages+0x242>
        p = le2page(le, page_link);
c0106e1e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106e21:	83 e8 0c             	sub    $0xc,%eax
c0106e24:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0106e27:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0106e2a:	89 45 c4             	mov    %eax,-0x3c(%ebp)
c0106e2d:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0106e30:	8b 40 04             	mov    0x4(%eax),%eax
        le = list_next(le);
c0106e33:	89 45 f0             	mov    %eax,-0x10(%ebp)
        if (base + base->property == p) {
c0106e36:	8b 45 08             	mov    0x8(%ebp),%eax
c0106e39:	8b 50 08             	mov    0x8(%eax),%edx
c0106e3c:	89 d0                	mov    %edx,%eax
c0106e3e:	c1 e0 03             	shl    $0x3,%eax
c0106e41:	01 d0                	add    %edx,%eax
c0106e43:	c1 e0 02             	shl    $0x2,%eax
c0106e46:	89 c2                	mov    %eax,%edx
c0106e48:	8b 45 08             	mov    0x8(%ebp),%eax
c0106e4b:	01 d0                	add    %edx,%eax
c0106e4d:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0106e50:	75 5d                	jne    c0106eaf <default_free_pages+0x1c5>
            base->property += p->property;
c0106e52:	8b 45 08             	mov    0x8(%ebp),%eax
c0106e55:	8b 50 08             	mov    0x8(%eax),%edx
c0106e58:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106e5b:	8b 40 08             	mov    0x8(%eax),%eax
c0106e5e:	01 c2                	add    %eax,%edx
c0106e60:	8b 45 08             	mov    0x8(%ebp),%eax
c0106e63:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(p);
c0106e66:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106e69:	83 c0 04             	add    $0x4,%eax
c0106e6c:	c7 45 b4 01 00 00 00 	movl   $0x1,-0x4c(%ebp)
c0106e73:	89 45 b0             	mov    %eax,-0x50(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0106e76:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0106e79:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0106e7c:	0f b3 10             	btr    %edx,(%eax)
}
c0106e7f:	90                   	nop
            list_del(&(p->page_link));
c0106e80:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106e83:	83 c0 0c             	add    $0xc,%eax
c0106e86:	89 45 c0             	mov    %eax,-0x40(%ebp)
    __list_del(listelm->prev, listelm->next);
c0106e89:	8b 45 c0             	mov    -0x40(%ebp),%eax
c0106e8c:	8b 40 04             	mov    0x4(%eax),%eax
c0106e8f:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0106e92:	8b 12                	mov    (%edx),%edx
c0106e94:	89 55 bc             	mov    %edx,-0x44(%ebp)
c0106e97:	89 45 b8             	mov    %eax,-0x48(%ebp)
    prev->next = next;
c0106e9a:	8b 45 bc             	mov    -0x44(%ebp),%eax
c0106e9d:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0106ea0:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0106ea3:	8b 45 b8             	mov    -0x48(%ebp),%eax
c0106ea6:	8b 55 bc             	mov    -0x44(%ebp),%edx
c0106ea9:	89 10                	mov    %edx,(%eax)
}
c0106eab:	90                   	nop
}
c0106eac:	90                   	nop
c0106ead:	eb 7d                	jmp    c0106f2c <default_free_pages+0x242>
        }
        else if (p + p->property == base) {
c0106eaf:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106eb2:	8b 50 08             	mov    0x8(%eax),%edx
c0106eb5:	89 d0                	mov    %edx,%eax
c0106eb7:	c1 e0 03             	shl    $0x3,%eax
c0106eba:	01 d0                	add    %edx,%eax
c0106ebc:	c1 e0 02             	shl    $0x2,%eax
c0106ebf:	89 c2                	mov    %eax,%edx
c0106ec1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106ec4:	01 d0                	add    %edx,%eax
c0106ec6:	39 45 08             	cmp    %eax,0x8(%ebp)
c0106ec9:	75 61                	jne    c0106f2c <default_free_pages+0x242>
            p->property += base->property;
c0106ecb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106ece:	8b 50 08             	mov    0x8(%eax),%edx
c0106ed1:	8b 45 08             	mov    0x8(%ebp),%eax
c0106ed4:	8b 40 08             	mov    0x8(%eax),%eax
c0106ed7:	01 c2                	add    %eax,%edx
c0106ed9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106edc:	89 50 08             	mov    %edx,0x8(%eax)
            ClearPageProperty(base);
c0106edf:	8b 45 08             	mov    0x8(%ebp),%eax
c0106ee2:	83 c0 04             	add    $0x4,%eax
c0106ee5:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
c0106eec:	89 45 9c             	mov    %eax,-0x64(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0106eef:	8b 45 9c             	mov    -0x64(%ebp),%eax
c0106ef2:	8b 55 a0             	mov    -0x60(%ebp),%edx
c0106ef5:	0f b3 10             	btr    %edx,(%eax)
}
c0106ef8:	90                   	nop
            base = p;
c0106ef9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106efc:	89 45 08             	mov    %eax,0x8(%ebp)
            list_del(&(p->page_link));
c0106eff:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0106f02:	83 c0 0c             	add    $0xc,%eax
c0106f05:	89 45 ac             	mov    %eax,-0x54(%ebp)
    __list_del(listelm->prev, listelm->next);
c0106f08:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0106f0b:	8b 40 04             	mov    0x4(%eax),%eax
c0106f0e:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0106f11:	8b 12                	mov    (%edx),%edx
c0106f13:	89 55 a8             	mov    %edx,-0x58(%ebp)
c0106f16:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    prev->next = next;
c0106f19:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0106f1c:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c0106f1f:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c0106f22:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c0106f25:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0106f28:	89 10                	mov    %edx,(%eax)
}
c0106f2a:	90                   	nop
}
c0106f2b:	90                   	nop
    while (le != &free_list) {
c0106f2c:	81 7d f0 e0 33 1c c0 	cmpl   $0xc01c33e0,-0x10(%ebp)
c0106f33:	0f 85 e5 fe ff ff    	jne    c0106e1e <default_free_pages+0x134>
        }
    }
    nr_free += n;
c0106f39:	8b 15 e8 33 1c c0    	mov    0xc01c33e8,%edx
c0106f3f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0106f42:	01 d0                	add    %edx,%eax
c0106f44:	a3 e8 33 1c c0       	mov    %eax,0xc01c33e8
c0106f49:	c7 45 98 e0 33 1c c0 	movl   $0xc01c33e0,-0x68(%ebp)
    return listelm->next;
c0106f50:	8b 45 98             	mov    -0x68(%ebp),%eax
c0106f53:	8b 40 04             	mov    0x4(%eax),%eax
    struct list_entry_t* it;
    for(it=list_next(&free_list);it!=&free_list && le2page(it,page_link)->property < base->property;it=list_next(it));
c0106f56:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0106f59:	eb 0f                	jmp    c0106f6a <default_free_pages+0x280>
c0106f5b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106f5e:	89 45 94             	mov    %eax,-0x6c(%ebp)
c0106f61:	8b 45 94             	mov    -0x6c(%ebp),%eax
c0106f64:	8b 40 04             	mov    0x4(%eax),%eax
c0106f67:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0106f6a:	81 7d ec e0 33 1c c0 	cmpl   $0xc01c33e0,-0x14(%ebp)
c0106f71:	74 13                	je     c0106f86 <default_free_pages+0x29c>
c0106f73:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106f76:	83 e8 0c             	sub    $0xc,%eax
c0106f79:	8b 50 08             	mov    0x8(%eax),%edx
c0106f7c:	8b 45 08             	mov    0x8(%ebp),%eax
c0106f7f:	8b 40 08             	mov    0x8(%eax),%eax
c0106f82:	39 c2                	cmp    %eax,%edx
c0106f84:	72 d5                	jb     c0106f5b <default_free_pages+0x271>
    {
    	//cprintf("%d %d \n",le2page(it,page_link)->property , base->property);
    }
    list_add(list_prev(it), &(base->page_link));
c0106f86:	8b 45 08             	mov    0x8(%ebp),%eax
c0106f89:	8d 50 0c             	lea    0xc(%eax),%edx
c0106f8c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0106f8f:	89 85 74 ff ff ff    	mov    %eax,-0x8c(%ebp)
    return listelm->prev;
c0106f95:	8b 85 74 ff ff ff    	mov    -0x8c(%ebp),%eax
c0106f9b:	8b 00                	mov    (%eax),%eax
c0106f9d:	89 45 90             	mov    %eax,-0x70(%ebp)
c0106fa0:	89 55 8c             	mov    %edx,-0x74(%ebp)
c0106fa3:	8b 45 90             	mov    -0x70(%ebp),%eax
c0106fa6:	89 45 88             	mov    %eax,-0x78(%ebp)
c0106fa9:	8b 45 8c             	mov    -0x74(%ebp),%eax
c0106fac:	89 45 84             	mov    %eax,-0x7c(%ebp)
    __list_add(elm, listelm, listelm->next);
c0106faf:	8b 45 88             	mov    -0x78(%ebp),%eax
c0106fb2:	8b 40 04             	mov    0x4(%eax),%eax
c0106fb5:	8b 55 84             	mov    -0x7c(%ebp),%edx
c0106fb8:	89 55 80             	mov    %edx,-0x80(%ebp)
c0106fbb:	8b 55 88             	mov    -0x78(%ebp),%edx
c0106fbe:	89 95 7c ff ff ff    	mov    %edx,-0x84(%ebp)
c0106fc4:	89 85 78 ff ff ff    	mov    %eax,-0x88(%ebp)
    prev->next = next->prev = elm;
c0106fca:	8b 85 78 ff ff ff    	mov    -0x88(%ebp),%eax
c0106fd0:	8b 55 80             	mov    -0x80(%ebp),%edx
c0106fd3:	89 10                	mov    %edx,(%eax)
c0106fd5:	8b 85 78 ff ff ff    	mov    -0x88(%ebp),%eax
c0106fdb:	8b 10                	mov    (%eax),%edx
c0106fdd:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
c0106fe3:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0106fe6:	8b 45 80             	mov    -0x80(%ebp),%eax
c0106fe9:	8b 95 78 ff ff ff    	mov    -0x88(%ebp),%edx
c0106fef:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0106ff2:	8b 45 80             	mov    -0x80(%ebp),%eax
c0106ff5:	8b 95 7c ff ff ff    	mov    -0x84(%ebp),%edx
c0106ffb:	89 10                	mov    %edx,(%eax)
}
c0106ffd:	90                   	nop
}
c0106ffe:	90                   	nop
}
c0106fff:	90                   	nop
}
c0107000:	90                   	nop
c0107001:	c9                   	leave  
c0107002:	c3                   	ret    

c0107003 <default_nr_free_pages>:

static size_t
default_nr_free_pages(void) {
c0107003:	f3 0f 1e fb          	endbr32 
c0107007:	55                   	push   %ebp
c0107008:	89 e5                	mov    %esp,%ebp
    return nr_free;
c010700a:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
}
c010700f:	5d                   	pop    %ebp
c0107010:	c3                   	ret    

c0107011 <basic_check>:

static void
basic_check(void) {
c0107011:	f3 0f 1e fb          	endbr32 
c0107015:	55                   	push   %ebp
c0107016:	89 e5                	mov    %esp,%ebp
c0107018:	83 ec 48             	sub    $0x48,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
c010701b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0107022:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107025:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0107028:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010702b:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert((p0 = alloc_page()) != NULL);
c010702e:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0107035:	e8 9d cd ff ff       	call   c0103dd7 <alloc_pages>
c010703a:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010703d:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0107041:	75 24                	jne    c0107067 <basic_check+0x56>
c0107043:	c7 44 24 0c 9d a8 10 	movl   $0xc010a89d,0xc(%esp)
c010704a:	c0 
c010704b:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107052:	c0 
c0107053:	c7 44 24 04 c5 00 00 	movl   $0xc5,0x4(%esp)
c010705a:	00 
c010705b:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107062:	e8 ba 93 ff ff       	call   c0100421 <__panic>
    assert((p1 = alloc_page()) != NULL);
c0107067:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010706e:	e8 64 cd ff ff       	call   c0103dd7 <alloc_pages>
c0107073:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0107076:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010707a:	75 24                	jne    c01070a0 <basic_check+0x8f>
c010707c:	c7 44 24 0c b9 a8 10 	movl   $0xc010a8b9,0xc(%esp)
c0107083:	c0 
c0107084:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c010708b:	c0 
c010708c:	c7 44 24 04 c6 00 00 	movl   $0xc6,0x4(%esp)
c0107093:	00 
c0107094:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c010709b:	e8 81 93 ff ff       	call   c0100421 <__panic>
    assert((p2 = alloc_page()) != NULL);
c01070a0:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01070a7:	e8 2b cd ff ff       	call   c0103dd7 <alloc_pages>
c01070ac:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01070af:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01070b3:	75 24                	jne    c01070d9 <basic_check+0xc8>
c01070b5:	c7 44 24 0c d5 a8 10 	movl   $0xc010a8d5,0xc(%esp)
c01070bc:	c0 
c01070bd:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01070c4:	c0 
c01070c5:	c7 44 24 04 c7 00 00 	movl   $0xc7,0x4(%esp)
c01070cc:	00 
c01070cd:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01070d4:	e8 48 93 ff ff       	call   c0100421 <__panic>

    assert(p0 != p1 && p0 != p2 && p1 != p2);
c01070d9:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01070dc:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c01070df:	74 10                	je     c01070f1 <basic_check+0xe0>
c01070e1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01070e4:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01070e7:	74 08                	je     c01070f1 <basic_check+0xe0>
c01070e9:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01070ec:	3b 45 f4             	cmp    -0xc(%ebp),%eax
c01070ef:	75 24                	jne    c0107115 <basic_check+0x104>
c01070f1:	c7 44 24 0c f4 a8 10 	movl   $0xc010a8f4,0xc(%esp)
c01070f8:	c0 
c01070f9:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107100:	c0 
c0107101:	c7 44 24 04 c9 00 00 	movl   $0xc9,0x4(%esp)
c0107108:	00 
c0107109:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107110:	e8 0c 93 ff ff       	call   c0100421 <__panic>
    assert(page_ref(p0) == 0 && page_ref(p1) == 0 && page_ref(p2) == 0);
c0107115:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107118:	89 04 24             	mov    %eax,(%esp)
c010711b:	e8 59 f8 ff ff       	call   c0106979 <page_ref>
c0107120:	85 c0                	test   %eax,%eax
c0107122:	75 1e                	jne    c0107142 <basic_check+0x131>
c0107124:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107127:	89 04 24             	mov    %eax,(%esp)
c010712a:	e8 4a f8 ff ff       	call   c0106979 <page_ref>
c010712f:	85 c0                	test   %eax,%eax
c0107131:	75 0f                	jne    c0107142 <basic_check+0x131>
c0107133:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107136:	89 04 24             	mov    %eax,(%esp)
c0107139:	e8 3b f8 ff ff       	call   c0106979 <page_ref>
c010713e:	85 c0                	test   %eax,%eax
c0107140:	74 24                	je     c0107166 <basic_check+0x155>
c0107142:	c7 44 24 0c 18 a9 10 	movl   $0xc010a918,0xc(%esp)
c0107149:	c0 
c010714a:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107151:	c0 
c0107152:	c7 44 24 04 ca 00 00 	movl   $0xca,0x4(%esp)
c0107159:	00 
c010715a:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107161:	e8 bb 92 ff ff       	call   c0100421 <__panic>

    assert(page2pa(p0) < npage * PGSIZE);
c0107166:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107169:	89 04 24             	mov    %eax,(%esp)
c010716c:	e8 f2 f7 ff ff       	call   c0106963 <page2pa>
c0107171:	8b 15 80 6e 12 c0    	mov    0xc0126e80,%edx
c0107177:	c1 e2 0c             	shl    $0xc,%edx
c010717a:	39 d0                	cmp    %edx,%eax
c010717c:	72 24                	jb     c01071a2 <basic_check+0x191>
c010717e:	c7 44 24 0c 54 a9 10 	movl   $0xc010a954,0xc(%esp)
c0107185:	c0 
c0107186:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c010718d:	c0 
c010718e:	c7 44 24 04 cc 00 00 	movl   $0xcc,0x4(%esp)
c0107195:	00 
c0107196:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c010719d:	e8 7f 92 ff ff       	call   c0100421 <__panic>
    assert(page2pa(p1) < npage * PGSIZE);
c01071a2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01071a5:	89 04 24             	mov    %eax,(%esp)
c01071a8:	e8 b6 f7 ff ff       	call   c0106963 <page2pa>
c01071ad:	8b 15 80 6e 12 c0    	mov    0xc0126e80,%edx
c01071b3:	c1 e2 0c             	shl    $0xc,%edx
c01071b6:	39 d0                	cmp    %edx,%eax
c01071b8:	72 24                	jb     c01071de <basic_check+0x1cd>
c01071ba:	c7 44 24 0c 71 a9 10 	movl   $0xc010a971,0xc(%esp)
c01071c1:	c0 
c01071c2:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01071c9:	c0 
c01071ca:	c7 44 24 04 cd 00 00 	movl   $0xcd,0x4(%esp)
c01071d1:	00 
c01071d2:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01071d9:	e8 43 92 ff ff       	call   c0100421 <__panic>
    assert(page2pa(p2) < npage * PGSIZE);
c01071de:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01071e1:	89 04 24             	mov    %eax,(%esp)
c01071e4:	e8 7a f7 ff ff       	call   c0106963 <page2pa>
c01071e9:	8b 15 80 6e 12 c0    	mov    0xc0126e80,%edx
c01071ef:	c1 e2 0c             	shl    $0xc,%edx
c01071f2:	39 d0                	cmp    %edx,%eax
c01071f4:	72 24                	jb     c010721a <basic_check+0x209>
c01071f6:	c7 44 24 0c 8e a9 10 	movl   $0xc010a98e,0xc(%esp)
c01071fd:	c0 
c01071fe:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107205:	c0 
c0107206:	c7 44 24 04 ce 00 00 	movl   $0xce,0x4(%esp)
c010720d:	00 
c010720e:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107215:	e8 07 92 ff ff       	call   c0100421 <__panic>

    list_entry_t free_list_store = free_list;
c010721a:	a1 e0 33 1c c0       	mov    0xc01c33e0,%eax
c010721f:	8b 15 e4 33 1c c0    	mov    0xc01c33e4,%edx
c0107225:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0107228:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c010722b:	c7 45 dc e0 33 1c c0 	movl   $0xc01c33e0,-0x24(%ebp)
    elm->prev = elm->next = elm;
c0107232:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0107235:	8b 55 dc             	mov    -0x24(%ebp),%edx
c0107238:	89 50 04             	mov    %edx,0x4(%eax)
c010723b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010723e:	8b 50 04             	mov    0x4(%eax),%edx
c0107241:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0107244:	89 10                	mov    %edx,(%eax)
}
c0107246:	90                   	nop
c0107247:	c7 45 e0 e0 33 1c c0 	movl   $0xc01c33e0,-0x20(%ebp)
    return list->next == list;
c010724e:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0107251:	8b 40 04             	mov    0x4(%eax),%eax
c0107254:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c0107257:	0f 94 c0             	sete   %al
c010725a:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
c010725d:	85 c0                	test   %eax,%eax
c010725f:	75 24                	jne    c0107285 <basic_check+0x274>
c0107261:	c7 44 24 0c ab a9 10 	movl   $0xc010a9ab,0xc(%esp)
c0107268:	c0 
c0107269:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107270:	c0 
c0107271:	c7 44 24 04 d2 00 00 	movl   $0xd2,0x4(%esp)
c0107278:	00 
c0107279:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107280:	e8 9c 91 ff ff       	call   c0100421 <__panic>

    unsigned int nr_free_store = nr_free;
c0107285:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
c010728a:	89 45 e8             	mov    %eax,-0x18(%ebp)
    nr_free = 0;
c010728d:	c7 05 e8 33 1c c0 00 	movl   $0x0,0xc01c33e8
c0107294:	00 00 00 

    assert(alloc_page() == NULL);
c0107297:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010729e:	e8 34 cb ff ff       	call   c0103dd7 <alloc_pages>
c01072a3:	85 c0                	test   %eax,%eax
c01072a5:	74 24                	je     c01072cb <basic_check+0x2ba>
c01072a7:	c7 44 24 0c c2 a9 10 	movl   $0xc010a9c2,0xc(%esp)
c01072ae:	c0 
c01072af:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01072b6:	c0 
c01072b7:	c7 44 24 04 d7 00 00 	movl   $0xd7,0x4(%esp)
c01072be:	00 
c01072bf:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01072c6:	e8 56 91 ff ff       	call   c0100421 <__panic>

    free_page(p0);
c01072cb:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01072d2:	00 
c01072d3:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01072d6:	89 04 24             	mov    %eax,(%esp)
c01072d9:	e8 35 cb ff ff       	call   c0103e13 <free_pages>
    free_page(p1);
c01072de:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01072e5:	00 
c01072e6:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01072e9:	89 04 24             	mov    %eax,(%esp)
c01072ec:	e8 22 cb ff ff       	call   c0103e13 <free_pages>
    free_page(p2);
c01072f1:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01072f8:	00 
c01072f9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01072fc:	89 04 24             	mov    %eax,(%esp)
c01072ff:	e8 0f cb ff ff       	call   c0103e13 <free_pages>
    assert(nr_free == 3);
c0107304:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
c0107309:	83 f8 03             	cmp    $0x3,%eax
c010730c:	74 24                	je     c0107332 <basic_check+0x321>
c010730e:	c7 44 24 0c d7 a9 10 	movl   $0xc010a9d7,0xc(%esp)
c0107315:	c0 
c0107316:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c010731d:	c0 
c010731e:	c7 44 24 04 dc 00 00 	movl   $0xdc,0x4(%esp)
c0107325:	00 
c0107326:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c010732d:	e8 ef 90 ff ff       	call   c0100421 <__panic>

    assert((p0 = alloc_page()) != NULL);
c0107332:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0107339:	e8 99 ca ff ff       	call   c0103dd7 <alloc_pages>
c010733e:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0107341:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0107345:	75 24                	jne    c010736b <basic_check+0x35a>
c0107347:	c7 44 24 0c 9d a8 10 	movl   $0xc010a89d,0xc(%esp)
c010734e:	c0 
c010734f:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107356:	c0 
c0107357:	c7 44 24 04 de 00 00 	movl   $0xde,0x4(%esp)
c010735e:	00 
c010735f:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107366:	e8 b6 90 ff ff       	call   c0100421 <__panic>
    assert((p1 = alloc_page()) != NULL);
c010736b:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0107372:	e8 60 ca ff ff       	call   c0103dd7 <alloc_pages>
c0107377:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010737a:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010737e:	75 24                	jne    c01073a4 <basic_check+0x393>
c0107380:	c7 44 24 0c b9 a8 10 	movl   $0xc010a8b9,0xc(%esp)
c0107387:	c0 
c0107388:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c010738f:	c0 
c0107390:	c7 44 24 04 df 00 00 	movl   $0xdf,0x4(%esp)
c0107397:	00 
c0107398:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c010739f:	e8 7d 90 ff ff       	call   c0100421 <__panic>
    assert((p2 = alloc_page()) != NULL);
c01073a4:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01073ab:	e8 27 ca ff ff       	call   c0103dd7 <alloc_pages>
c01073b0:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01073b3:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c01073b7:	75 24                	jne    c01073dd <basic_check+0x3cc>
c01073b9:	c7 44 24 0c d5 a8 10 	movl   $0xc010a8d5,0xc(%esp)
c01073c0:	c0 
c01073c1:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01073c8:	c0 
c01073c9:	c7 44 24 04 e0 00 00 	movl   $0xe0,0x4(%esp)
c01073d0:	00 
c01073d1:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01073d8:	e8 44 90 ff ff       	call   c0100421 <__panic>

    assert(alloc_page() == NULL);
c01073dd:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01073e4:	e8 ee c9 ff ff       	call   c0103dd7 <alloc_pages>
c01073e9:	85 c0                	test   %eax,%eax
c01073eb:	74 24                	je     c0107411 <basic_check+0x400>
c01073ed:	c7 44 24 0c c2 a9 10 	movl   $0xc010a9c2,0xc(%esp)
c01073f4:	c0 
c01073f5:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01073fc:	c0 
c01073fd:	c7 44 24 04 e2 00 00 	movl   $0xe2,0x4(%esp)
c0107404:	00 
c0107405:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c010740c:	e8 10 90 ff ff       	call   c0100421 <__panic>

    free_page(p0);
c0107411:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0107418:	00 
c0107419:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010741c:	89 04 24             	mov    %eax,(%esp)
c010741f:	e8 ef c9 ff ff       	call   c0103e13 <free_pages>
c0107424:	c7 45 d8 e0 33 1c c0 	movl   $0xc01c33e0,-0x28(%ebp)
c010742b:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010742e:	8b 40 04             	mov    0x4(%eax),%eax
c0107431:	39 45 d8             	cmp    %eax,-0x28(%ebp)
c0107434:	0f 94 c0             	sete   %al
c0107437:	0f b6 c0             	movzbl %al,%eax
    assert(!list_empty(&free_list));
c010743a:	85 c0                	test   %eax,%eax
c010743c:	74 24                	je     c0107462 <basic_check+0x451>
c010743e:	c7 44 24 0c e4 a9 10 	movl   $0xc010a9e4,0xc(%esp)
c0107445:	c0 
c0107446:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c010744d:	c0 
c010744e:	c7 44 24 04 e5 00 00 	movl   $0xe5,0x4(%esp)
c0107455:	00 
c0107456:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c010745d:	e8 bf 8f ff ff       	call   c0100421 <__panic>

    struct Page *p;
    assert((p = alloc_page()) == p0);
c0107462:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0107469:	e8 69 c9 ff ff       	call   c0103dd7 <alloc_pages>
c010746e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0107471:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0107474:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0107477:	74 24                	je     c010749d <basic_check+0x48c>
c0107479:	c7 44 24 0c fc a9 10 	movl   $0xc010a9fc,0xc(%esp)
c0107480:	c0 
c0107481:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107488:	c0 
c0107489:	c7 44 24 04 e8 00 00 	movl   $0xe8,0x4(%esp)
c0107490:	00 
c0107491:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107498:	e8 84 8f ff ff       	call   c0100421 <__panic>
    assert(alloc_page() == NULL);
c010749d:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c01074a4:	e8 2e c9 ff ff       	call   c0103dd7 <alloc_pages>
c01074a9:	85 c0                	test   %eax,%eax
c01074ab:	74 24                	je     c01074d1 <basic_check+0x4c0>
c01074ad:	c7 44 24 0c c2 a9 10 	movl   $0xc010a9c2,0xc(%esp)
c01074b4:	c0 
c01074b5:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01074bc:	c0 
c01074bd:	c7 44 24 04 e9 00 00 	movl   $0xe9,0x4(%esp)
c01074c4:	00 
c01074c5:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01074cc:	e8 50 8f ff ff       	call   c0100421 <__panic>

    assert(nr_free == 0);
c01074d1:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
c01074d6:	85 c0                	test   %eax,%eax
c01074d8:	74 24                	je     c01074fe <basic_check+0x4ed>
c01074da:	c7 44 24 0c 15 aa 10 	movl   $0xc010aa15,0xc(%esp)
c01074e1:	c0 
c01074e2:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01074e9:	c0 
c01074ea:	c7 44 24 04 eb 00 00 	movl   $0xeb,0x4(%esp)
c01074f1:	00 
c01074f2:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01074f9:	e8 23 8f ff ff       	call   c0100421 <__panic>
    free_list = free_list_store;
c01074fe:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0107501:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0107504:	a3 e0 33 1c c0       	mov    %eax,0xc01c33e0
c0107509:	89 15 e4 33 1c c0    	mov    %edx,0xc01c33e4
    nr_free = nr_free_store;
c010750f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107512:	a3 e8 33 1c c0       	mov    %eax,0xc01c33e8

    free_page(p);
c0107517:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c010751e:	00 
c010751f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0107522:	89 04 24             	mov    %eax,(%esp)
c0107525:	e8 e9 c8 ff ff       	call   c0103e13 <free_pages>
    free_page(p1);
c010752a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0107531:	00 
c0107532:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107535:	89 04 24             	mov    %eax,(%esp)
c0107538:	e8 d6 c8 ff ff       	call   c0103e13 <free_pages>
    free_page(p2);
c010753d:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0107544:	00 
c0107545:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107548:	89 04 24             	mov    %eax,(%esp)
c010754b:	e8 c3 c8 ff ff       	call   c0103e13 <free_pages>
}
c0107550:	90                   	nop
c0107551:	c9                   	leave  
c0107552:	c3                   	ret    

c0107553 <default_check>:

// LAB2: below code is used to check the first fit allocation algorithm (your EXERCISE 1) 
// NOTICE: You SHOULD NOT CHANGE basic_check, default_check functions!
static void
default_check(void) {
c0107553:	f3 0f 1e fb          	endbr32 
c0107557:	55                   	push   %ebp
c0107558:	89 e5                	mov    %esp,%ebp
c010755a:	81 ec 98 00 00 00    	sub    $0x98,%esp
    int count = 0, total = 0;
c0107560:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0107567:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    list_entry_t *le = &free_list;
c010756e:	c7 45 ec e0 33 1c c0 	movl   $0xc01c33e0,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0107575:	eb 6a                	jmp    c01075e1 <default_check+0x8e>
        struct Page *p = le2page(le, page_link);
c0107577:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010757a:	83 e8 0c             	sub    $0xc,%eax
c010757d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
        assert(PageProperty(p));
c0107580:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0107583:	83 c0 04             	add    $0x4,%eax
c0107586:	c7 45 d0 01 00 00 00 	movl   $0x1,-0x30(%ebp)
c010758d:	89 45 cc             	mov    %eax,-0x34(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0107590:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0107593:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0107596:	0f a3 10             	bt     %edx,(%eax)
c0107599:	19 c0                	sbb    %eax,%eax
c010759b:	89 45 c8             	mov    %eax,-0x38(%ebp)
    return oldbit != 0;
c010759e:	83 7d c8 00          	cmpl   $0x0,-0x38(%ebp)
c01075a2:	0f 95 c0             	setne  %al
c01075a5:	0f b6 c0             	movzbl %al,%eax
c01075a8:	85 c0                	test   %eax,%eax
c01075aa:	75 24                	jne    c01075d0 <default_check+0x7d>
c01075ac:	c7 44 24 0c 22 aa 10 	movl   $0xc010aa22,0xc(%esp)
c01075b3:	c0 
c01075b4:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01075bb:	c0 
c01075bc:	c7 44 24 04 fc 00 00 	movl   $0xfc,0x4(%esp)
c01075c3:	00 
c01075c4:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01075cb:	e8 51 8e ff ff       	call   c0100421 <__panic>
        count ++, total += p->property;
c01075d0:	ff 45 f4             	incl   -0xc(%ebp)
c01075d3:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01075d6:	8b 50 08             	mov    0x8(%eax),%edx
c01075d9:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01075dc:	01 d0                	add    %edx,%eax
c01075de:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01075e1:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01075e4:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return listelm->next;
c01075e7:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c01075ea:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c01075ed:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01075f0:	81 7d ec e0 33 1c c0 	cmpl   $0xc01c33e0,-0x14(%ebp)
c01075f7:	0f 85 7a ff ff ff    	jne    c0107577 <default_check+0x24>
    }
    assert(total == nr_free_pages());
c01075fd:	e8 48 c8 ff ff       	call   c0103e4a <nr_free_pages>
c0107602:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0107605:	39 d0                	cmp    %edx,%eax
c0107607:	74 24                	je     c010762d <default_check+0xda>
c0107609:	c7 44 24 0c 32 aa 10 	movl   $0xc010aa32,0xc(%esp)
c0107610:	c0 
c0107611:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107618:	c0 
c0107619:	c7 44 24 04 ff 00 00 	movl   $0xff,0x4(%esp)
c0107620:	00 
c0107621:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107628:	e8 f4 8d ff ff       	call   c0100421 <__panic>

    basic_check();
c010762d:	e8 df f9 ff ff       	call   c0107011 <basic_check>

    struct Page *p0 = alloc_pages(5), *p1, *p2;
c0107632:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
c0107639:	e8 99 c7 ff ff       	call   c0103dd7 <alloc_pages>
c010763e:	89 45 e8             	mov    %eax,-0x18(%ebp)
    assert(p0 != NULL);
c0107641:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0107645:	75 24                	jne    c010766b <default_check+0x118>
c0107647:	c7 44 24 0c 4b aa 10 	movl   $0xc010aa4b,0xc(%esp)
c010764e:	c0 
c010764f:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107656:	c0 
c0107657:	c7 44 24 04 04 01 00 	movl   $0x104,0x4(%esp)
c010765e:	00 
c010765f:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107666:	e8 b6 8d ff ff       	call   c0100421 <__panic>
    assert(!PageProperty(p0));
c010766b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010766e:	83 c0 04             	add    $0x4,%eax
c0107671:	c7 45 c0 01 00 00 00 	movl   $0x1,-0x40(%ebp)
c0107678:	89 45 bc             	mov    %eax,-0x44(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c010767b:	8b 45 bc             	mov    -0x44(%ebp),%eax
c010767e:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0107681:	0f a3 10             	bt     %edx,(%eax)
c0107684:	19 c0                	sbb    %eax,%eax
c0107686:	89 45 b8             	mov    %eax,-0x48(%ebp)
    return oldbit != 0;
c0107689:	83 7d b8 00          	cmpl   $0x0,-0x48(%ebp)
c010768d:	0f 95 c0             	setne  %al
c0107690:	0f b6 c0             	movzbl %al,%eax
c0107693:	85 c0                	test   %eax,%eax
c0107695:	74 24                	je     c01076bb <default_check+0x168>
c0107697:	c7 44 24 0c 56 aa 10 	movl   $0xc010aa56,0xc(%esp)
c010769e:	c0 
c010769f:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01076a6:	c0 
c01076a7:	c7 44 24 04 05 01 00 	movl   $0x105,0x4(%esp)
c01076ae:	00 
c01076af:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01076b6:	e8 66 8d ff ff       	call   c0100421 <__panic>

    list_entry_t free_list_store = free_list;
c01076bb:	a1 e0 33 1c c0       	mov    0xc01c33e0,%eax
c01076c0:	8b 15 e4 33 1c c0    	mov    0xc01c33e4,%edx
c01076c6:	89 45 80             	mov    %eax,-0x80(%ebp)
c01076c9:	89 55 84             	mov    %edx,-0x7c(%ebp)
c01076cc:	c7 45 b0 e0 33 1c c0 	movl   $0xc01c33e0,-0x50(%ebp)
    elm->prev = elm->next = elm;
c01076d3:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01076d6:	8b 55 b0             	mov    -0x50(%ebp),%edx
c01076d9:	89 50 04             	mov    %edx,0x4(%eax)
c01076dc:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01076df:	8b 50 04             	mov    0x4(%eax),%edx
c01076e2:	8b 45 b0             	mov    -0x50(%ebp),%eax
c01076e5:	89 10                	mov    %edx,(%eax)
}
c01076e7:	90                   	nop
c01076e8:	c7 45 b4 e0 33 1c c0 	movl   $0xc01c33e0,-0x4c(%ebp)
    return list->next == list;
c01076ef:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c01076f2:	8b 40 04             	mov    0x4(%eax),%eax
c01076f5:	39 45 b4             	cmp    %eax,-0x4c(%ebp)
c01076f8:	0f 94 c0             	sete   %al
c01076fb:	0f b6 c0             	movzbl %al,%eax
    list_init(&free_list);
    assert(list_empty(&free_list));
c01076fe:	85 c0                	test   %eax,%eax
c0107700:	75 24                	jne    c0107726 <default_check+0x1d3>
c0107702:	c7 44 24 0c ab a9 10 	movl   $0xc010a9ab,0xc(%esp)
c0107709:	c0 
c010770a:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107711:	c0 
c0107712:	c7 44 24 04 09 01 00 	movl   $0x109,0x4(%esp)
c0107719:	00 
c010771a:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107721:	e8 fb 8c ff ff       	call   c0100421 <__panic>
    assert(alloc_page() == NULL);
c0107726:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010772d:	e8 a5 c6 ff ff       	call   c0103dd7 <alloc_pages>
c0107732:	85 c0                	test   %eax,%eax
c0107734:	74 24                	je     c010775a <default_check+0x207>
c0107736:	c7 44 24 0c c2 a9 10 	movl   $0xc010a9c2,0xc(%esp)
c010773d:	c0 
c010773e:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107745:	c0 
c0107746:	c7 44 24 04 0a 01 00 	movl   $0x10a,0x4(%esp)
c010774d:	00 
c010774e:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107755:	e8 c7 8c ff ff       	call   c0100421 <__panic>

    unsigned int nr_free_store = nr_free;
c010775a:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
c010775f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    nr_free = 0;
c0107762:	c7 05 e8 33 1c c0 00 	movl   $0x0,0xc01c33e8
c0107769:	00 00 00 

    free_pages(p0 + 2, 3);
c010776c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010776f:	83 c0 48             	add    $0x48,%eax
c0107772:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c0107779:	00 
c010777a:	89 04 24             	mov    %eax,(%esp)
c010777d:	e8 91 c6 ff ff       	call   c0103e13 <free_pages>
    assert(alloc_pages(4) == NULL);
c0107782:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c0107789:	e8 49 c6 ff ff       	call   c0103dd7 <alloc_pages>
c010778e:	85 c0                	test   %eax,%eax
c0107790:	74 24                	je     c01077b6 <default_check+0x263>
c0107792:	c7 44 24 0c 68 aa 10 	movl   $0xc010aa68,0xc(%esp)
c0107799:	c0 
c010779a:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01077a1:	c0 
c01077a2:	c7 44 24 04 10 01 00 	movl   $0x110,0x4(%esp)
c01077a9:	00 
c01077aa:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01077b1:	e8 6b 8c ff ff       	call   c0100421 <__panic>
    assert(PageProperty(p0 + 2) && p0[2].property == 3);
c01077b6:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01077b9:	83 c0 48             	add    $0x48,%eax
c01077bc:	83 c0 04             	add    $0x4,%eax
c01077bf:	c7 45 ac 01 00 00 00 	movl   $0x1,-0x54(%ebp)
c01077c6:	89 45 a8             	mov    %eax,-0x58(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01077c9:	8b 45 a8             	mov    -0x58(%ebp),%eax
c01077cc:	8b 55 ac             	mov    -0x54(%ebp),%edx
c01077cf:	0f a3 10             	bt     %edx,(%eax)
c01077d2:	19 c0                	sbb    %eax,%eax
c01077d4:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    return oldbit != 0;
c01077d7:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
c01077db:	0f 95 c0             	setne  %al
c01077de:	0f b6 c0             	movzbl %al,%eax
c01077e1:	85 c0                	test   %eax,%eax
c01077e3:	74 0e                	je     c01077f3 <default_check+0x2a0>
c01077e5:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01077e8:	83 c0 48             	add    $0x48,%eax
c01077eb:	8b 40 08             	mov    0x8(%eax),%eax
c01077ee:	83 f8 03             	cmp    $0x3,%eax
c01077f1:	74 24                	je     c0107817 <default_check+0x2c4>
c01077f3:	c7 44 24 0c 80 aa 10 	movl   $0xc010aa80,0xc(%esp)
c01077fa:	c0 
c01077fb:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107802:	c0 
c0107803:	c7 44 24 04 11 01 00 	movl   $0x111,0x4(%esp)
c010780a:	00 
c010780b:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107812:	e8 0a 8c ff ff       	call   c0100421 <__panic>
    assert((p1 = alloc_pages(3)) != NULL);
c0107817:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
c010781e:	e8 b4 c5 ff ff       	call   c0103dd7 <alloc_pages>
c0107823:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0107826:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c010782a:	75 24                	jne    c0107850 <default_check+0x2fd>
c010782c:	c7 44 24 0c ac aa 10 	movl   $0xc010aaac,0xc(%esp)
c0107833:	c0 
c0107834:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c010783b:	c0 
c010783c:	c7 44 24 04 12 01 00 	movl   $0x112,0x4(%esp)
c0107843:	00 
c0107844:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c010784b:	e8 d1 8b ff ff       	call   c0100421 <__panic>
    assert(alloc_page() == NULL);
c0107850:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0107857:	e8 7b c5 ff ff       	call   c0103dd7 <alloc_pages>
c010785c:	85 c0                	test   %eax,%eax
c010785e:	74 24                	je     c0107884 <default_check+0x331>
c0107860:	c7 44 24 0c c2 a9 10 	movl   $0xc010a9c2,0xc(%esp)
c0107867:	c0 
c0107868:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c010786f:	c0 
c0107870:	c7 44 24 04 13 01 00 	movl   $0x113,0x4(%esp)
c0107877:	00 
c0107878:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c010787f:	e8 9d 8b ff ff       	call   c0100421 <__panic>
    assert(p0 + 2 == p1);
c0107884:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107887:	83 c0 48             	add    $0x48,%eax
c010788a:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c010788d:	74 24                	je     c01078b3 <default_check+0x360>
c010788f:	c7 44 24 0c ca aa 10 	movl   $0xc010aaca,0xc(%esp)
c0107896:	c0 
c0107897:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c010789e:	c0 
c010789f:	c7 44 24 04 14 01 00 	movl   $0x114,0x4(%esp)
c01078a6:	00 
c01078a7:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01078ae:	e8 6e 8b ff ff       	call   c0100421 <__panic>

    p2 = p0 + 1;
c01078b3:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01078b6:	83 c0 24             	add    $0x24,%eax
c01078b9:	89 45 dc             	mov    %eax,-0x24(%ebp)
    free_page(p0);
c01078bc:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01078c3:	00 
c01078c4:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01078c7:	89 04 24             	mov    %eax,(%esp)
c01078ca:	e8 44 c5 ff ff       	call   c0103e13 <free_pages>
    free_pages(p1, 3);
c01078cf:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c01078d6:	00 
c01078d7:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01078da:	89 04 24             	mov    %eax,(%esp)
c01078dd:	e8 31 c5 ff ff       	call   c0103e13 <free_pages>
    assert(PageProperty(p0) && p0->property == 1);
c01078e2:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01078e5:	83 c0 04             	add    $0x4,%eax
c01078e8:	c7 45 a0 01 00 00 00 	movl   $0x1,-0x60(%ebp)
c01078ef:	89 45 9c             	mov    %eax,-0x64(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c01078f2:	8b 45 9c             	mov    -0x64(%ebp),%eax
c01078f5:	8b 55 a0             	mov    -0x60(%ebp),%edx
c01078f8:	0f a3 10             	bt     %edx,(%eax)
c01078fb:	19 c0                	sbb    %eax,%eax
c01078fd:	89 45 98             	mov    %eax,-0x68(%ebp)
    return oldbit != 0;
c0107900:	83 7d 98 00          	cmpl   $0x0,-0x68(%ebp)
c0107904:	0f 95 c0             	setne  %al
c0107907:	0f b6 c0             	movzbl %al,%eax
c010790a:	85 c0                	test   %eax,%eax
c010790c:	74 0b                	je     c0107919 <default_check+0x3c6>
c010790e:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107911:	8b 40 08             	mov    0x8(%eax),%eax
c0107914:	83 f8 01             	cmp    $0x1,%eax
c0107917:	74 24                	je     c010793d <default_check+0x3ea>
c0107919:	c7 44 24 0c d8 aa 10 	movl   $0xc010aad8,0xc(%esp)
c0107920:	c0 
c0107921:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107928:	c0 
c0107929:	c7 44 24 04 19 01 00 	movl   $0x119,0x4(%esp)
c0107930:	00 
c0107931:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107938:	e8 e4 8a ff ff       	call   c0100421 <__panic>
    assert(PageProperty(p1) && p1->property == 3);
c010793d:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0107940:	83 c0 04             	add    $0x4,%eax
c0107943:	c7 45 94 01 00 00 00 	movl   $0x1,-0x6c(%ebp)
c010794a:	89 45 90             	mov    %eax,-0x70(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c010794d:	8b 45 90             	mov    -0x70(%ebp),%eax
c0107950:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0107953:	0f a3 10             	bt     %edx,(%eax)
c0107956:	19 c0                	sbb    %eax,%eax
c0107958:	89 45 8c             	mov    %eax,-0x74(%ebp)
    return oldbit != 0;
c010795b:	83 7d 8c 00          	cmpl   $0x0,-0x74(%ebp)
c010795f:	0f 95 c0             	setne  %al
c0107962:	0f b6 c0             	movzbl %al,%eax
c0107965:	85 c0                	test   %eax,%eax
c0107967:	74 0b                	je     c0107974 <default_check+0x421>
c0107969:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010796c:	8b 40 08             	mov    0x8(%eax),%eax
c010796f:	83 f8 03             	cmp    $0x3,%eax
c0107972:	74 24                	je     c0107998 <default_check+0x445>
c0107974:	c7 44 24 0c 00 ab 10 	movl   $0xc010ab00,0xc(%esp)
c010797b:	c0 
c010797c:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107983:	c0 
c0107984:	c7 44 24 04 1a 01 00 	movl   $0x11a,0x4(%esp)
c010798b:	00 
c010798c:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107993:	e8 89 8a ff ff       	call   c0100421 <__panic>

    assert((p0 = alloc_page()) == p2 - 1);
c0107998:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010799f:	e8 33 c4 ff ff       	call   c0103dd7 <alloc_pages>
c01079a4:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01079a7:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01079aa:	83 e8 24             	sub    $0x24,%eax
c01079ad:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c01079b0:	74 24                	je     c01079d6 <default_check+0x483>
c01079b2:	c7 44 24 0c 26 ab 10 	movl   $0xc010ab26,0xc(%esp)
c01079b9:	c0 
c01079ba:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c01079c1:	c0 
c01079c2:	c7 44 24 04 1c 01 00 	movl   $0x11c,0x4(%esp)
c01079c9:	00 
c01079ca:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c01079d1:	e8 4b 8a ff ff       	call   c0100421 <__panic>
    free_page(p0);
c01079d6:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01079dd:	00 
c01079de:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01079e1:	89 04 24             	mov    %eax,(%esp)
c01079e4:	e8 2a c4 ff ff       	call   c0103e13 <free_pages>
    assert((p0 = alloc_pages(2)) == p2 + 1);
c01079e9:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
c01079f0:	e8 e2 c3 ff ff       	call   c0103dd7 <alloc_pages>
c01079f5:	89 45 e8             	mov    %eax,-0x18(%ebp)
c01079f8:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01079fb:	83 c0 24             	add    $0x24,%eax
c01079fe:	39 45 e8             	cmp    %eax,-0x18(%ebp)
c0107a01:	74 24                	je     c0107a27 <default_check+0x4d4>
c0107a03:	c7 44 24 0c 44 ab 10 	movl   $0xc010ab44,0xc(%esp)
c0107a0a:	c0 
c0107a0b:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107a12:	c0 
c0107a13:	c7 44 24 04 1e 01 00 	movl   $0x11e,0x4(%esp)
c0107a1a:	00 
c0107a1b:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107a22:	e8 fa 89 ff ff       	call   c0100421 <__panic>

    free_pages(p0, 2);
c0107a27:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
c0107a2e:	00 
c0107a2f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107a32:	89 04 24             	mov    %eax,(%esp)
c0107a35:	e8 d9 c3 ff ff       	call   c0103e13 <free_pages>
    free_page(p2);
c0107a3a:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c0107a41:	00 
c0107a42:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0107a45:	89 04 24             	mov    %eax,(%esp)
c0107a48:	e8 c6 c3 ff ff       	call   c0103e13 <free_pages>

    assert((p0 = alloc_pages(5)) != NULL);
c0107a4d:	c7 04 24 05 00 00 00 	movl   $0x5,(%esp)
c0107a54:	e8 7e c3 ff ff       	call   c0103dd7 <alloc_pages>
c0107a59:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0107a5c:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0107a60:	75 24                	jne    c0107a86 <default_check+0x533>
c0107a62:	c7 44 24 0c 64 ab 10 	movl   $0xc010ab64,0xc(%esp)
c0107a69:	c0 
c0107a6a:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107a71:	c0 
c0107a72:	c7 44 24 04 23 01 00 	movl   $0x123,0x4(%esp)
c0107a79:	00 
c0107a7a:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107a81:	e8 9b 89 ff ff       	call   c0100421 <__panic>
    assert(alloc_page() == NULL);
c0107a86:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0107a8d:	e8 45 c3 ff ff       	call   c0103dd7 <alloc_pages>
c0107a92:	85 c0                	test   %eax,%eax
c0107a94:	74 24                	je     c0107aba <default_check+0x567>
c0107a96:	c7 44 24 0c c2 a9 10 	movl   $0xc010a9c2,0xc(%esp)
c0107a9d:	c0 
c0107a9e:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107aa5:	c0 
c0107aa6:	c7 44 24 04 24 01 00 	movl   $0x124,0x4(%esp)
c0107aad:	00 
c0107aae:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107ab5:	e8 67 89 ff ff       	call   c0100421 <__panic>

    assert(nr_free == 0);
c0107aba:	a1 e8 33 1c c0       	mov    0xc01c33e8,%eax
c0107abf:	85 c0                	test   %eax,%eax
c0107ac1:	74 24                	je     c0107ae7 <default_check+0x594>
c0107ac3:	c7 44 24 0c 15 aa 10 	movl   $0xc010aa15,0xc(%esp)
c0107aca:	c0 
c0107acb:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107ad2:	c0 
c0107ad3:	c7 44 24 04 26 01 00 	movl   $0x126,0x4(%esp)
c0107ada:	00 
c0107adb:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107ae2:	e8 3a 89 ff ff       	call   c0100421 <__panic>
    nr_free = nr_free_store;
c0107ae7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0107aea:	a3 e8 33 1c c0       	mov    %eax,0xc01c33e8

    free_list = free_list_store;
c0107aef:	8b 45 80             	mov    -0x80(%ebp),%eax
c0107af2:	8b 55 84             	mov    -0x7c(%ebp),%edx
c0107af5:	a3 e0 33 1c c0       	mov    %eax,0xc01c33e0
c0107afa:	89 15 e4 33 1c c0    	mov    %edx,0xc01c33e4
    free_pages(p0, 5);
c0107b00:	c7 44 24 04 05 00 00 	movl   $0x5,0x4(%esp)
c0107b07:	00 
c0107b08:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107b0b:	89 04 24             	mov    %eax,(%esp)
c0107b0e:	e8 00 c3 ff ff       	call   c0103e13 <free_pages>

    le = &free_list;
c0107b13:	c7 45 ec e0 33 1c c0 	movl   $0xc01c33e0,-0x14(%ebp)
    while ((le = list_next(le)) != &free_list) {
c0107b1a:	eb 5a                	jmp    c0107b76 <default_check+0x623>
        assert(le->next->prev == le && le->prev->next == le);
c0107b1c:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107b1f:	8b 40 04             	mov    0x4(%eax),%eax
c0107b22:	8b 00                	mov    (%eax),%eax
c0107b24:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0107b27:	75 0d                	jne    c0107b36 <default_check+0x5e3>
c0107b29:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107b2c:	8b 00                	mov    (%eax),%eax
c0107b2e:	8b 40 04             	mov    0x4(%eax),%eax
c0107b31:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0107b34:	74 24                	je     c0107b5a <default_check+0x607>
c0107b36:	c7 44 24 0c 84 ab 10 	movl   $0xc010ab84,0xc(%esp)
c0107b3d:	c0 
c0107b3e:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107b45:	c0 
c0107b46:	c7 44 24 04 2e 01 00 	movl   $0x12e,0x4(%esp)
c0107b4d:	00 
c0107b4e:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107b55:	e8 c7 88 ff ff       	call   c0100421 <__panic>
        struct Page *p = le2page(le, page_link);
c0107b5a:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107b5d:	83 e8 0c             	sub    $0xc,%eax
c0107b60:	89 45 d8             	mov    %eax,-0x28(%ebp)
        count --, total -= p->property;
c0107b63:	ff 4d f4             	decl   -0xc(%ebp)
c0107b66:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0107b69:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0107b6c:	8b 40 08             	mov    0x8(%eax),%eax
c0107b6f:	29 c2                	sub    %eax,%edx
c0107b71:	89 d0                	mov    %edx,%eax
c0107b73:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0107b76:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107b79:	89 45 88             	mov    %eax,-0x78(%ebp)
    return listelm->next;
c0107b7c:	8b 45 88             	mov    -0x78(%ebp),%eax
c0107b7f:	8b 40 04             	mov    0x4(%eax),%eax
    while ((le = list_next(le)) != &free_list) {
c0107b82:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0107b85:	81 7d ec e0 33 1c c0 	cmpl   $0xc01c33e0,-0x14(%ebp)
c0107b8c:	75 8e                	jne    c0107b1c <default_check+0x5c9>
    }
    assert(count == 0);
c0107b8e:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0107b92:	74 24                	je     c0107bb8 <default_check+0x665>
c0107b94:	c7 44 24 0c b1 ab 10 	movl   $0xc010abb1,0xc(%esp)
c0107b9b:	c0 
c0107b9c:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107ba3:	c0 
c0107ba4:	c7 44 24 04 32 01 00 	movl   $0x132,0x4(%esp)
c0107bab:	00 
c0107bac:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107bb3:	e8 69 88 ff ff       	call   c0100421 <__panic>
    assert(total == 0);
c0107bb8:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0107bbc:	74 24                	je     c0107be2 <default_check+0x68f>
c0107bbe:	c7 44 24 0c bc ab 10 	movl   $0xc010abbc,0xc(%esp)
c0107bc5:	c0 
c0107bc6:	c7 44 24 08 3a a8 10 	movl   $0xc010a83a,0x8(%esp)
c0107bcd:	c0 
c0107bce:	c7 44 24 04 33 01 00 	movl   $0x133,0x4(%esp)
c0107bd5:	00 
c0107bd6:	c7 04 24 4f a8 10 c0 	movl   $0xc010a84f,(%esp)
c0107bdd:	e8 3f 88 ff ff       	call   c0100421 <__panic>
}
c0107be2:	90                   	nop
c0107be3:	c9                   	leave  
c0107be4:	c3                   	ret    

c0107be5 <page2ppn>:
page2ppn(struct Page *page) {
c0107be5:	55                   	push   %ebp
c0107be6:	89 e5                	mov    %esp,%ebp
    return page - pages;
c0107be8:	a1 08 da 2a c0       	mov    0xc02ada08,%eax
c0107bed:	8b 55 08             	mov    0x8(%ebp),%edx
c0107bf0:	29 c2                	sub    %eax,%edx
c0107bf2:	89 d0                	mov    %edx,%eax
c0107bf4:	c1 f8 02             	sar    $0x2,%eax
c0107bf7:	69 c0 39 8e e3 38    	imul   $0x38e38e39,%eax,%eax
}
c0107bfd:	5d                   	pop    %ebp
c0107bfe:	c3                   	ret    

c0107bff <set_page_ref>:
set_page_ref(struct Page *page, int val) {
c0107bff:	55                   	push   %ebp
c0107c00:	89 e5                	mov    %esp,%ebp
    page->ref = val;
c0107c02:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c05:	8b 55 0c             	mov    0xc(%ebp),%edx
c0107c08:	89 10                	mov    %edx,(%eax)
}
c0107c0a:	90                   	nop
c0107c0b:	5d                   	pop    %ebp
c0107c0c:	c3                   	ret    

c0107c0d <IsPowerOf2>:
#define buddy_array (buddy_s.free_array)
#define max_order (buddy_s.max_order)
#define nr_free (buddy_s.nr_free)

static bool IsPowerOf2(size_t n)
{
c0107c0d:	f3 0f 1e fb          	endbr32 
c0107c11:	55                   	push   %ebp
c0107c12:	89 e5                	mov    %esp,%ebp
    return n&(n-1)==0;
c0107c14:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
c0107c18:	0f 94 c0             	sete   %al
c0107c1b:	0f b6 c0             	movzbl %al,%eax
c0107c1e:	23 45 08             	and    0x8(%ebp),%eax
}
c0107c21:	5d                   	pop    %ebp
c0107c22:	c3                   	ret    

c0107c23 <GetOrder>:

static unsigned int GetOrder(size_t n)
{
c0107c23:	f3 0f 1e fb          	endbr32 
c0107c27:	55                   	push   %ebp
c0107c28:	89 e5                	mov    %esp,%ebp
c0107c2a:	83 ec 10             	sub    $0x10,%esp
    int order=0;
c0107c2d:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while(n>>1)
c0107c34:	eb 06                	jmp    c0107c3c <GetOrder+0x19>
    {
        n>>=1;
c0107c36:	d1 6d 08             	shrl   0x8(%ebp)
        order++;
c0107c39:	ff 45 fc             	incl   -0x4(%ebp)
    while(n>>1)
c0107c3c:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c3f:	d1 e8                	shr    %eax
c0107c41:	85 c0                	test   %eax,%eax
c0107c43:	75 f1                	jne    c0107c36 <GetOrder+0x13>
    }
    return order;
c0107c45:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c0107c48:	c9                   	leave  
c0107c49:	c3                   	ret    

c0107c4a <FixUp>:

static unsigned FixUp(unsigned size) {
c0107c4a:	f3 0f 1e fb          	endbr32 
c0107c4e:	55                   	push   %ebp
c0107c4f:	89 e5                	mov    %esp,%ebp
c0107c51:	83 ec 04             	sub    $0x4,%esp
    if(IsPowerOf2(size))
c0107c54:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c57:	89 04 24             	mov    %eax,(%esp)
c0107c5a:	e8 ae ff ff ff       	call   c0107c0d <IsPowerOf2>
c0107c5f:	85 c0                	test   %eax,%eax
c0107c61:	74 05                	je     c0107c68 <FixUp+0x1e>
    {
        return size;
c0107c63:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c66:	eb 30                	jmp    c0107c98 <FixUp+0x4e>
    }
    size |= size >> 1;
c0107c68:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c6b:	d1 e8                	shr    %eax
c0107c6d:	09 45 08             	or     %eax,0x8(%ebp)
    size |= size >> 2;
c0107c70:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c73:	c1 e8 02             	shr    $0x2,%eax
c0107c76:	09 45 08             	or     %eax,0x8(%ebp)
    size |= size >> 4;
c0107c79:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c7c:	c1 e8 04             	shr    $0x4,%eax
c0107c7f:	09 45 08             	or     %eax,0x8(%ebp)
    size |= size >> 8;
c0107c82:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c85:	c1 e8 08             	shr    $0x8,%eax
c0107c88:	09 45 08             	or     %eax,0x8(%ebp)
    size |= size >> 16;
c0107c8b:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c8e:	c1 e8 10             	shr    $0x10,%eax
c0107c91:	09 45 08             	or     %eax,0x8(%ebp)
    return size+1;
c0107c94:	8b 45 08             	mov    0x8(%ebp),%eax
c0107c97:	40                   	inc    %eax
}
c0107c98:	c9                   	leave  
c0107c99:	c3                   	ret    

c0107c9a <FixDown>:

static unsigned FixDown(unsigned size) 
{
c0107c9a:	f3 0f 1e fb          	endbr32 
c0107c9e:	55                   	push   %ebp
c0107c9f:	89 e5                	mov    %esp,%ebp
c0107ca1:	83 ec 04             	sub    $0x4,%esp
    if(IsPowerOf2(size))
c0107ca4:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ca7:	89 04 24             	mov    %eax,(%esp)
c0107caa:	e8 5e ff ff ff       	call   c0107c0d <IsPowerOf2>
c0107caf:	85 c0                	test   %eax,%eax
c0107cb1:	74 05                	je     c0107cb8 <FixDown+0x1e>
    {
        return size;
c0107cb3:	8b 45 08             	mov    0x8(%ebp),%eax
c0107cb6:	eb 0d                	jmp    c0107cc5 <FixDown+0x2b>
    }
    return (FixUp(size)>>1);
c0107cb8:	8b 45 08             	mov    0x8(%ebp),%eax
c0107cbb:	89 04 24             	mov    %eax,(%esp)
c0107cbe:	e8 87 ff ff ff       	call   c0107c4a <FixUp>
c0107cc3:	d1 e8                	shr    %eax
}
c0107cc5:	c9                   	leave  
c0107cc6:	c3                   	ret    

c0107cc7 <show_buddy_array>:

static void show_buddy_array(void) 
{
c0107cc7:	f3 0f 1e fb          	endbr32 
c0107ccb:	55                   	push   %ebp
c0107ccc:	89 e5                	mov    %esp,%ebp
c0107cce:	83 ec 28             	sub    $0x28,%esp
    cprintf("[*]Core: Print buddy array:\n");
c0107cd1:	c7 04 24 f8 ab 10 c0 	movl   $0xc010abf8,(%esp)
c0107cd8:	e8 d8 85 ff ff       	call   c01002b5 <cprintf>
    for (int i = 0;i < max_order + 1;i ++) 
c0107cdd:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0107ce4:	e9 81 00 00 00       	jmp    c0107d6a <show_buddy_array+0xa3>
    {
        cprintf("%d order: ", i);
c0107ce9:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107cec:	89 44 24 04          	mov    %eax,0x4(%esp)
c0107cf0:	c7 04 24 15 ac 10 c0 	movl   $0xc010ac15,(%esp)
c0107cf7:	e8 b9 85 ff ff       	call   c01002b5 <cprintf>
        list_entry_t *le = &(buddy_array[i]);
c0107cfc:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107cff:	c1 e0 03             	shl    $0x3,%eax
c0107d02:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c0107d07:	83 c0 04             	add    $0x4,%eax
c0107d0a:	89 45 f0             	mov    %eax,-0x10(%ebp)
        while ((le = list_next(le)) != &(buddy_array[i])) 
c0107d0d:	eb 2a                	jmp    c0107d39 <show_buddy_array+0x72>
        {
            struct Page *p = le2page(le, page_link);
c0107d0f:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107d12:	83 e8 0c             	sub    $0xc,%eax
c0107d15:	89 45 ec             	mov    %eax,-0x14(%ebp)
            cprintf("%d ", 1 << (p->property));
c0107d18:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107d1b:	8b 40 08             	mov    0x8(%eax),%eax
c0107d1e:	ba 01 00 00 00       	mov    $0x1,%edx
c0107d23:	88 c1                	mov    %al,%cl
c0107d25:	d3 e2                	shl    %cl,%edx
c0107d27:	89 d0                	mov    %edx,%eax
c0107d29:	89 44 24 04          	mov    %eax,0x4(%esp)
c0107d2d:	c7 04 24 20 ac 10 c0 	movl   $0xc010ac20,(%esp)
c0107d34:	e8 7c 85 ff ff       	call   c01002b5 <cprintf>
c0107d39:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107d3c:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0107d3f:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0107d42:	8b 40 04             	mov    0x4(%eax),%eax
        while ((le = list_next(le)) != &(buddy_array[i])) 
c0107d45:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0107d48:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107d4b:	c1 e0 03             	shl    $0x3,%eax
c0107d4e:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c0107d53:	83 c0 04             	add    $0x4,%eax
c0107d56:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0107d59:	75 b4                	jne    c0107d0f <show_buddy_array+0x48>
        }
        cprintf("\n");
c0107d5b:	c7 04 24 24 ac 10 c0 	movl   $0xc010ac24,(%esp)
c0107d62:	e8 4e 85 ff ff       	call   c01002b5 <cprintf>
    for (int i = 0;i < max_order + 1;i ++) 
c0107d67:	ff 45 f4             	incl   -0xc(%ebp)
c0107d6a:	a1 20 da 2a c0       	mov    0xc02ada20,%eax
c0107d6f:	8d 50 01             	lea    0x1(%eax),%edx
c0107d72:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107d75:	39 c2                	cmp    %eax,%edx
c0107d77:	0f 87 6c ff ff ff    	ja     c0107ce9 <show_buddy_array+0x22>
    }
    cprintf("---------------------------\n");
c0107d7d:	c7 04 24 26 ac 10 c0 	movl   $0xc010ac26,(%esp)
c0107d84:	e8 2c 85 ff ff       	call   c01002b5 <cprintf>
    return;
c0107d89:	90                   	nop
}
c0107d8a:	c9                   	leave  
c0107d8b:	c3                   	ret    

c0107d8c <buddy_init>:

static void buddy_init()
{
c0107d8c:	f3 0f 1e fb          	endbr32 
c0107d90:	55                   	push   %ebp
c0107d91:	89 e5                	mov    %esp,%ebp
c0107d93:	83 ec 10             	sub    $0x10,%esp
    for(int i=0;i<MAX_BUDDY_ORDER;i++)
c0107d96:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
c0107d9d:	eb 29                	jmp    c0107dc8 <buddy_init+0x3c>
    {
        list_init(&buddy_array[i]);
c0107d9f:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0107da2:	c1 e0 03             	shl    $0x3,%eax
c0107da5:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c0107daa:	83 c0 04             	add    $0x4,%eax
c0107dad:	89 45 f8             	mov    %eax,-0x8(%ebp)
    elm->prev = elm->next = elm;
c0107db0:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0107db3:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0107db6:	89 50 04             	mov    %edx,0x4(%eax)
c0107db9:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0107dbc:	8b 50 04             	mov    0x4(%eax),%edx
c0107dbf:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0107dc2:	89 10                	mov    %edx,(%eax)
}
c0107dc4:	90                   	nop
    for(int i=0;i<MAX_BUDDY_ORDER;i++)
c0107dc5:	ff 45 fc             	incl   -0x4(%ebp)
c0107dc8:	83 7d fc 13          	cmpl   $0x13,-0x4(%ebp)
c0107dcc:	7e d1                	jle    c0107d9f <buddy_init+0x13>
    }
    max_order=0;
c0107dce:	c7 05 20 da 2a c0 00 	movl   $0x0,0xc02ada20
c0107dd5:	00 00 00 
    nr_free=0;
c0107dd8:	c7 05 cc da 2a c0 00 	movl   $0x0,0xc02adacc
c0107ddf:	00 00 00 
    return;
c0107de2:	90                   	nop
}
c0107de3:	c9                   	leave  
c0107de4:	c3                   	ret    

c0107de5 <buddy_init_memmap>:

static void buddy_init_memmap(struct Page* base,size_t n)
{
c0107de5:	f3 0f 1e fb          	endbr32 
c0107de9:	55                   	push   %ebp
c0107dea:	89 e5                	mov    %esp,%ebp
c0107dec:	83 ec 58             	sub    $0x58,%esp
    assert(n>0);
c0107def:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0107df3:	75 24                	jne    c0107e19 <buddy_init_memmap+0x34>
c0107df5:	c7 44 24 0c 43 ac 10 	movl   $0xc010ac43,0xc(%esp)
c0107dfc:	c0 
c0107dfd:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0107e04:	c0 
c0107e05:	c7 44 24 04 5b 00 00 	movl   $0x5b,0x4(%esp)
c0107e0c:	00 
c0107e0d:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0107e14:	e8 08 86 ff ff       	call   c0100421 <__panic>
    size_t pcnt=FixDown(n);
c0107e19:	8b 45 0c             	mov    0xc(%ebp),%eax
c0107e1c:	89 04 24             	mov    %eax,(%esp)
c0107e1f:	e8 76 fe ff ff       	call   c0107c9a <FixDown>
c0107e24:	89 45 f0             	mov    %eax,-0x10(%ebp)
    size_t order=GetOrder(pcnt);
c0107e27:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107e2a:	89 04 24             	mov    %eax,(%esp)
c0107e2d:	e8 f1 fd ff ff       	call   c0107c23 <GetOrder>
c0107e32:	89 45 ec             	mov    %eax,-0x14(%ebp)
    struct Page* p=base;
c0107e35:	8b 45 08             	mov    0x8(%ebp),%eax
c0107e38:	89 45 f4             	mov    %eax,-0xc(%ebp)
    cprintf("[*]Core: AVA Page num after rounding down to powers of 2: %d = 2^%d\n", pcnt, order);
c0107e3b:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107e3e:	89 44 24 08          	mov    %eax,0x8(%esp)
c0107e42:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107e45:	89 44 24 04          	mov    %eax,0x4(%esp)
c0107e49:	c7 04 24 70 ac 10 c0 	movl   $0xc010ac70,(%esp)
c0107e50:	e8 60 84 ff ff       	call   c01002b5 <cprintf>
    for(;p!=base+pcnt;p++)
c0107e55:	eb 7b                	jmp    c0107ed2 <buddy_init_memmap+0xed>
    {
        assert(PageReserved(p));
c0107e57:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107e5a:	83 c0 04             	add    $0x4,%eax
c0107e5d:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
c0107e64:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0107e67:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0107e6a:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0107e6d:	0f a3 10             	bt     %edx,(%eax)
c0107e70:	19 c0                	sbb    %eax,%eax
c0107e72:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return oldbit != 0;
c0107e75:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
c0107e79:	0f 95 c0             	setne  %al
c0107e7c:	0f b6 c0             	movzbl %al,%eax
c0107e7f:	85 c0                	test   %eax,%eax
c0107e81:	75 24                	jne    c0107ea7 <buddy_init_memmap+0xc2>
c0107e83:	c7 44 24 0c b5 ac 10 	movl   $0xc010acb5,0xc(%esp)
c0107e8a:	c0 
c0107e8b:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0107e92:	c0 
c0107e93:	c7 44 24 04 62 00 00 	movl   $0x62,0x4(%esp)
c0107e9a:	00 
c0107e9b:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0107ea2:	e8 7a 85 ff ff       	call   c0100421 <__panic>
        p->flags=0;
c0107ea7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107eaa:	c7 40 04 00 00 00 00 	movl   $0x0,0x4(%eax)
        p->property=-1;
c0107eb1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107eb4:	c7 40 08 ff ff ff ff 	movl   $0xffffffff,0x8(%eax)
        set_page_ref(p,0);
c0107ebb:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
c0107ec2:	00 
c0107ec3:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107ec6:	89 04 24             	mov    %eax,(%esp)
c0107ec9:	e8 31 fd ff ff       	call   c0107bff <set_page_ref>
    for(;p!=base+pcnt;p++)
c0107ece:	83 45 f4 24          	addl   $0x24,-0xc(%ebp)
c0107ed2:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0107ed5:	89 d0                	mov    %edx,%eax
c0107ed7:	c1 e0 03             	shl    $0x3,%eax
c0107eda:	01 d0                	add    %edx,%eax
c0107edc:	c1 e0 02             	shl    $0x2,%eax
c0107edf:	89 c2                	mov    %eax,%edx
c0107ee1:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ee4:	01 d0                	add    %edx,%eax
c0107ee6:	39 45 f4             	cmp    %eax,-0xc(%ebp)
c0107ee9:	0f 85 68 ff ff ff    	jne    c0107e57 <buddy_init_memmap+0x72>
    }
    max_order=order;
c0107eef:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0107ef2:	a3 20 da 2a c0       	mov    %eax,0xc02ada20
    nr_free=pcnt;
c0107ef7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0107efa:	a3 cc da 2a c0       	mov    %eax,0xc02adacc
    list_add(&(buddy_array[max_order]),&(base->page_link));
c0107eff:	8b 45 08             	mov    0x8(%ebp),%eax
c0107f02:	83 c0 0c             	add    $0xc,%eax
c0107f05:	8b 15 20 da 2a c0    	mov    0xc02ada20,%edx
c0107f0b:	c1 e2 03             	shl    $0x3,%edx
c0107f0e:	81 c2 20 da 2a c0    	add    $0xc02ada20,%edx
c0107f14:	83 c2 04             	add    $0x4,%edx
c0107f17:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0107f1a:	89 45 d8             	mov    %eax,-0x28(%ebp)
c0107f1d:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0107f20:	89 45 d4             	mov    %eax,-0x2c(%ebp)
c0107f23:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0107f26:	89 45 d0             	mov    %eax,-0x30(%ebp)
    __list_add(elm, listelm, listelm->next);
c0107f29:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0107f2c:	8b 40 04             	mov    0x4(%eax),%eax
c0107f2f:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0107f32:	89 55 cc             	mov    %edx,-0x34(%ebp)
c0107f35:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0107f38:	89 55 c8             	mov    %edx,-0x38(%ebp)
c0107f3b:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    prev->next = next->prev = elm;
c0107f3e:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0107f41:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0107f44:	89 10                	mov    %edx,(%eax)
c0107f46:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0107f49:	8b 10                	mov    (%eax),%edx
c0107f4b:	8b 45 c8             	mov    -0x38(%ebp),%eax
c0107f4e:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0107f51:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0107f54:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c0107f57:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0107f5a:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0107f5d:	8b 55 c8             	mov    -0x38(%ebp),%edx
c0107f60:	89 10                	mov    %edx,(%eax)
}
c0107f62:	90                   	nop
}
c0107f63:	90                   	nop
}
c0107f64:	90                   	nop
    base->property=max_order;
c0107f65:	8b 15 20 da 2a c0    	mov    0xc02ada20,%edx
c0107f6b:	8b 45 08             	mov    0x8(%ebp),%eax
c0107f6e:	89 50 08             	mov    %edx,0x8(%eax)
    return;
c0107f71:	90                   	nop
}
c0107f72:	c9                   	leave  
c0107f73:	c3                   	ret    

c0107f74 <buddy_find>:

static struct Page* buddy_find(struct Page *page) 
{
c0107f74:	f3 0f 1e fb          	endbr32 
c0107f78:	55                   	push   %ebp
c0107f79:	89 e5                	mov    %esp,%ebp
c0107f7b:	53                   	push   %ebx
c0107f7c:	83 ec 24             	sub    $0x24,%esp
    unsigned int order = page->property;
c0107f7f:	8b 45 08             	mov    0x8(%ebp),%eax
c0107f82:	8b 40 08             	mov    0x8(%eax),%eax
c0107f85:	89 45 f4             	mov    %eax,-0xc(%ebp)
    unsigned int buddy_ppn = first_ppn + ((1 << order) ^ (page2ppn(page) - first_ppn));
c0107f88:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0107f8b:	ba 01 00 00 00       	mov    $0x1,%edx
c0107f90:	88 c1                	mov    %al,%cl
c0107f92:	d3 e2                	shl    %cl,%edx
c0107f94:	89 d0                	mov    %edx,%eax
c0107f96:	89 c3                	mov    %eax,%ebx
c0107f98:	8b 45 08             	mov    0x8(%ebp),%eax
c0107f9b:	89 04 24             	mov    %eax,(%esp)
c0107f9e:	e8 42 fc ff ff       	call   c0107be5 <page2ppn>
c0107fa3:	8b 15 84 6e 12 c0    	mov    0xc0126e84,%edx
c0107fa9:	29 d0                	sub    %edx,%eax
c0107fab:	31 c3                	xor    %eax,%ebx
c0107fad:	89 da                	mov    %ebx,%edx
c0107faf:	a1 84 6e 12 c0       	mov    0xc0126e84,%eax
c0107fb4:	01 d0                	add    %edx,%eax
c0107fb6:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cprintf("[*]Core: Page NO.%d 's buddy page on order %d is: %d\n", page2ppn(page), order, buddy_ppn);
c0107fb9:	8b 45 08             	mov    0x8(%ebp),%eax
c0107fbc:	89 04 24             	mov    %eax,(%esp)
c0107fbf:	e8 21 fc ff ff       	call   c0107be5 <page2ppn>
c0107fc4:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0107fc7:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0107fcb:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0107fce:	89 54 24 08          	mov    %edx,0x8(%esp)
c0107fd2:	89 44 24 04          	mov    %eax,0x4(%esp)
c0107fd6:	c7 04 24 c8 ac 10 c0 	movl   $0xc010acc8,(%esp)
c0107fdd:	e8 d3 82 ff ff       	call   c01002b5 <cprintf>
    if (buddy_ppn > page2ppn(page))
c0107fe2:	8b 45 08             	mov    0x8(%ebp),%eax
c0107fe5:	89 04 24             	mov    %eax,(%esp)
c0107fe8:	e8 f8 fb ff ff       	call   c0107be5 <page2ppn>
c0107fed:	39 45 f0             	cmp    %eax,-0x10(%ebp)
c0107ff0:	76 23                	jbe    c0108015 <buddy_find+0xa1>
    {
        return page + (buddy_ppn - page2ppn(page));
c0107ff2:	8b 45 08             	mov    0x8(%ebp),%eax
c0107ff5:	89 04 24             	mov    %eax,(%esp)
c0107ff8:	e8 e8 fb ff ff       	call   c0107be5 <page2ppn>
c0107ffd:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0108000:	29 c2                	sub    %eax,%edx
c0108002:	89 d0                	mov    %edx,%eax
c0108004:	c1 e0 03             	shl    $0x3,%eax
c0108007:	01 d0                	add    %edx,%eax
c0108009:	c1 e0 02             	shl    $0x2,%eax
c010800c:	89 c2                	mov    %eax,%edx
c010800e:	8b 45 08             	mov    0x8(%ebp),%eax
c0108011:	01 d0                	add    %edx,%eax
c0108013:	eb 23                	jmp    c0108038 <buddy_find+0xc4>
    }
    else 
    {
        return page - (page2ppn(page) - buddy_ppn);
c0108015:	8b 45 08             	mov    0x8(%ebp),%eax
c0108018:	89 04 24             	mov    %eax,(%esp)
c010801b:	e8 c5 fb ff ff       	call   c0107be5 <page2ppn>
c0108020:	2b 45 f0             	sub    -0x10(%ebp),%eax
c0108023:	89 c2                	mov    %eax,%edx
c0108025:	89 d0                	mov    %edx,%eax
c0108027:	c1 e0 03             	shl    $0x3,%eax
c010802a:	01 d0                	add    %edx,%eax
c010802c:	c1 e0 02             	shl    $0x2,%eax
c010802f:	f7 d8                	neg    %eax
c0108031:	89 c2                	mov    %eax,%edx
c0108033:	8b 45 08             	mov    0x8(%ebp),%eax
c0108036:	01 d0                	add    %edx,%eax
    }
}
c0108038:	83 c4 24             	add    $0x24,%esp
c010803b:	5b                   	pop    %ebx
c010803c:	5d                   	pop    %ebp
c010803d:	c3                   	ret    

c010803e <buddy_split>:

static void buddy_split(size_t n) 
{
c010803e:	f3 0f 1e fb          	endbr32 
c0108042:	55                   	push   %ebp
c0108043:	89 e5                	mov    %esp,%ebp
c0108045:	83 ec 78             	sub    $0x78,%esp
    assert(n > 0 && n <= max_order);
c0108048:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c010804c:	74 0a                	je     c0108058 <buddy_split+0x1a>
c010804e:	a1 20 da 2a c0       	mov    0xc02ada20,%eax
c0108053:	39 45 08             	cmp    %eax,0x8(%ebp)
c0108056:	76 24                	jbe    c010807c <buddy_split+0x3e>
c0108058:	c7 44 24 0c fe ac 10 	movl   $0xc010acfe,0xc(%esp)
c010805f:	c0 
c0108060:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0108067:	c0 
c0108068:	c7 44 24 04 7f 00 00 	movl   $0x7f,0x4(%esp)
c010806f:	00 
c0108070:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0108077:	e8 a5 83 ff ff       	call   c0100421 <__panic>
    assert(!list_empty(&(buddy_array[n])));
c010807c:	8b 45 08             	mov    0x8(%ebp),%eax
c010807f:	c1 e0 03             	shl    $0x3,%eax
c0108082:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c0108087:	83 c0 04             	add    $0x4,%eax
c010808a:	89 45 ec             	mov    %eax,-0x14(%ebp)
    return list->next == list;
c010808d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0108090:	8b 40 04             	mov    0x4(%eax),%eax
c0108093:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c0108096:	0f 94 c0             	sete   %al
c0108099:	0f b6 c0             	movzbl %al,%eax
c010809c:	85 c0                	test   %eax,%eax
c010809e:	74 24                	je     c01080c4 <buddy_split+0x86>
c01080a0:	c7 44 24 0c 18 ad 10 	movl   $0xc010ad18,0xc(%esp)
c01080a7:	c0 
c01080a8:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c01080af:	c0 
c01080b0:	c7 44 24 04 80 00 00 	movl   $0x80,0x4(%esp)
c01080b7:	00 
c01080b8:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c01080bf:	e8 5d 83 ff ff       	call   c0100421 <__panic>
    cprintf("[*]Core: SPLITTING!\n");
c01080c4:	c7 04 24 37 ad 10 c0 	movl   $0xc010ad37,(%esp)
c01080cb:	e8 e5 81 ff ff       	call   c01002b5 <cprintf>
    struct Page *page_a;
    struct Page *page_b;

    page_a = le2page(list_next(&(buddy_array[n])), page_link);
c01080d0:	8b 45 08             	mov    0x8(%ebp),%eax
c01080d3:	c1 e0 03             	shl    $0x3,%eax
c01080d6:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c01080db:	83 c0 04             	add    $0x4,%eax
c01080de:	89 45 a0             	mov    %eax,-0x60(%ebp)
    return listelm->next;
c01080e1:	8b 45 a0             	mov    -0x60(%ebp),%eax
c01080e4:	8b 40 04             	mov    0x4(%eax),%eax
c01080e7:	83 e8 0c             	sub    $0xc,%eax
c01080ea:	89 45 f4             	mov    %eax,-0xc(%ebp)
    page_b = page_a + (1 << (n - 1));
c01080ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01080f0:	48                   	dec    %eax
c01080f1:	ba 24 00 00 00       	mov    $0x24,%edx
c01080f6:	88 c1                	mov    %al,%cl
c01080f8:	d3 e2                	shl    %cl,%edx
c01080fa:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01080fd:	01 d0                	add    %edx,%eax
c01080ff:	89 45 f0             	mov    %eax,-0x10(%ebp)
    page_a->property = n - 1;
c0108102:	8b 45 08             	mov    0x8(%ebp),%eax
c0108105:	8d 50 ff             	lea    -0x1(%eax),%edx
c0108108:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010810b:	89 50 08             	mov    %edx,0x8(%eax)
    page_b->property = n - 1;
c010810e:	8b 45 08             	mov    0x8(%ebp),%eax
c0108111:	8d 50 ff             	lea    -0x1(%eax),%edx
c0108114:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108117:	89 50 08             	mov    %edx,0x8(%eax)

    list_del(list_next(&(buddy_array[n])));
c010811a:	8b 45 08             	mov    0x8(%ebp),%eax
c010811d:	c1 e0 03             	shl    $0x3,%eax
c0108120:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c0108125:	83 c0 04             	add    $0x4,%eax
c0108128:	89 45 a4             	mov    %eax,-0x5c(%ebp)
c010812b:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c010812e:	8b 40 04             	mov    0x4(%eax),%eax
c0108131:	89 45 b0             	mov    %eax,-0x50(%ebp)
    __list_del(listelm->prev, listelm->next);
c0108134:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0108137:	8b 40 04             	mov    0x4(%eax),%eax
c010813a:	8b 55 b0             	mov    -0x50(%ebp),%edx
c010813d:	8b 12                	mov    (%edx),%edx
c010813f:	89 55 ac             	mov    %edx,-0x54(%ebp)
c0108142:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next;
c0108145:	8b 45 ac             	mov    -0x54(%ebp),%eax
c0108148:	8b 55 a8             	mov    -0x58(%ebp),%edx
c010814b:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c010814e:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0108151:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0108154:	89 10                	mov    %edx,(%eax)
}
c0108156:	90                   	nop
}
c0108157:	90                   	nop
    list_add(&(buddy_array[n-1]), &(page_a->page_link));
c0108158:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010815b:	83 c0 0c             	add    $0xc,%eax
c010815e:	8b 55 08             	mov    0x8(%ebp),%edx
c0108161:	4a                   	dec    %edx
c0108162:	c1 e2 03             	shl    $0x3,%edx
c0108165:	81 c2 20 da 2a c0    	add    $0xc02ada20,%edx
c010816b:	83 c2 04             	add    $0x4,%edx
c010816e:	89 55 cc             	mov    %edx,-0x34(%ebp)
c0108171:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0108174:	8b 45 cc             	mov    -0x34(%ebp),%eax
c0108177:	89 45 c4             	mov    %eax,-0x3c(%ebp)
c010817a:	8b 45 c8             	mov    -0x38(%ebp),%eax
c010817d:	89 45 c0             	mov    %eax,-0x40(%ebp)
    __list_add(elm, listelm, listelm->next);
c0108180:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c0108183:	8b 40 04             	mov    0x4(%eax),%eax
c0108186:	8b 55 c0             	mov    -0x40(%ebp),%edx
c0108189:	89 55 bc             	mov    %edx,-0x44(%ebp)
c010818c:	8b 55 c4             	mov    -0x3c(%ebp),%edx
c010818f:	89 55 b8             	mov    %edx,-0x48(%ebp)
c0108192:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    prev->next = next->prev = elm;
c0108195:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c0108198:	8b 55 bc             	mov    -0x44(%ebp),%edx
c010819b:	89 10                	mov    %edx,(%eax)
c010819d:	8b 45 b4             	mov    -0x4c(%ebp),%eax
c01081a0:	8b 10                	mov    (%eax),%edx
c01081a2:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01081a5:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c01081a8:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01081ab:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c01081ae:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c01081b1:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01081b4:	8b 55 b8             	mov    -0x48(%ebp),%edx
c01081b7:	89 10                	mov    %edx,(%eax)
}
c01081b9:	90                   	nop
}
c01081ba:	90                   	nop
}
c01081bb:	90                   	nop
    list_add(&(page_a->page_link), &(page_b->page_link));
c01081bc:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01081bf:	83 c0 0c             	add    $0xc,%eax
c01081c2:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01081c5:	83 c2 0c             	add    $0xc,%edx
c01081c8:	89 55 e8             	mov    %edx,-0x18(%ebp)
c01081cb:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01081ce:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01081d1:	89 45 e0             	mov    %eax,-0x20(%ebp)
c01081d4:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01081d7:	89 45 dc             	mov    %eax,-0x24(%ebp)
    __list_add(elm, listelm, listelm->next);
c01081da:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01081dd:	8b 40 04             	mov    0x4(%eax),%eax
c01081e0:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01081e3:	89 55 d8             	mov    %edx,-0x28(%ebp)
c01081e6:	8b 55 e0             	mov    -0x20(%ebp),%edx
c01081e9:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c01081ec:	89 45 d0             	mov    %eax,-0x30(%ebp)
    prev->next = next->prev = elm;
c01081ef:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01081f2:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01081f5:	89 10                	mov    %edx,(%eax)
c01081f7:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01081fa:	8b 10                	mov    (%eax),%edx
c01081fc:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01081ff:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0108202:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0108205:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0108208:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c010820b:	8b 45 d8             	mov    -0x28(%ebp),%eax
c010820e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0108211:	89 10                	mov    %edx,(%eax)
}
c0108213:	90                   	nop
}
c0108214:	90                   	nop
}
c0108215:	90                   	nop

    return;
c0108216:	90                   	nop
}
c0108217:	c9                   	leave  
c0108218:	c3                   	ret    

c0108219 <buddy_alloc_pages>:

static struct Page *buddy_alloc_pages(size_t n) 
{
c0108219:	f3 0f 1e fb          	endbr32 
c010821d:	55                   	push   %ebp
c010821e:	89 e5                	mov    %esp,%ebp
c0108220:	83 ec 58             	sub    $0x58,%esp
    assert(n > 0);
c0108223:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c0108227:	75 24                	jne    c010824d <buddy_alloc_pages+0x34>
c0108229:	c7 44 24 0c 4c ad 10 	movl   $0xc010ad4c,0xc(%esp)
c0108230:	c0 
c0108231:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0108238:	c0 
c0108239:	c7 44 24 04 93 00 00 	movl   $0x93,0x4(%esp)
c0108240:	00 
c0108241:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0108248:	e8 d4 81 ff ff       	call   c0100421 <__panic>
    if (n > nr_free) 
c010824d:	a1 cc da 2a c0       	mov    0xc02adacc,%eax
c0108252:	39 45 08             	cmp    %eax,0x8(%ebp)
c0108255:	76 0a                	jbe    c0108261 <buddy_alloc_pages+0x48>
    {
        return NULL;
c0108257:	b8 00 00 00 00       	mov    $0x0,%eax
c010825c:	e9 82 01 00 00       	jmp    c01083e3 <buddy_alloc_pages+0x1ca>
    }
    struct Page *page = NULL;
c0108261:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    size_t pnum = FixUp(n);
c0108268:	8b 45 08             	mov    0x8(%ebp),%eax
c010826b:	89 04 24             	mov    %eax,(%esp)
c010826e:	e8 d7 f9 ff ff       	call   c0107c4a <FixUp>
c0108273:	89 45 ec             	mov    %eax,-0x14(%ebp)
    size_t order = 0;
c0108276:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
    order = GetOrder(pnum);
c010827d:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0108280:	89 04 24             	mov    %eax,(%esp)
c0108283:	e8 9b f9 ff ff       	call   c0107c23 <GetOrder>
c0108288:	89 45 e8             	mov    %eax,-0x18(%ebp)
    cprintf("[*]Core: Allocating %d-->%d = 2^%d pages ...\n", n, pnum, order);
c010828b:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010828e:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0108292:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0108295:	89 44 24 08          	mov    %eax,0x8(%esp)
c0108299:	8b 45 08             	mov    0x8(%ebp),%eax
c010829c:	89 44 24 04          	mov    %eax,0x4(%esp)
c01082a0:	c7 04 24 54 ad 10 c0 	movl   $0xc010ad54,(%esp)
c01082a7:	e8 09 80 ff ff       	call   c01002b5 <cprintf>
    cprintf("[*]COre: Buddy array before ALLOC:\n");
c01082ac:	c7 04 24 84 ad 10 c0 	movl   $0xc010ad84,(%esp)
c01082b3:	e8 fd 7f ff ff       	call   c01002b5 <cprintf>
    //show_buddy_array();
    while(list_empty(&buddy_array[order]))
c01082b8:	eb 4b                	jmp    c0108305 <buddy_alloc_pages+0xec>
    {
        for(int i=order;i<max_order+1;i++)
c01082ba:	8b 45 e8             	mov    -0x18(%ebp),%eax
c01082bd:	89 45 f4             	mov    %eax,-0xc(%ebp)
c01082c0:	eb 34                	jmp    c01082f6 <buddy_alloc_pages+0xdd>
        {
            if(!list_empty(&buddy_array[i]))
c01082c2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01082c5:	c1 e0 03             	shl    $0x3,%eax
c01082c8:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c01082cd:	83 c0 04             	add    $0x4,%eax
c01082d0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    return list->next == list;
c01082d3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01082d6:	8b 40 04             	mov    0x4(%eax),%eax
c01082d9:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
c01082dc:	0f 94 c0             	sete   %al
c01082df:	0f b6 c0             	movzbl %al,%eax
c01082e2:	85 c0                	test   %eax,%eax
c01082e4:	75 0d                	jne    c01082f3 <buddy_alloc_pages+0xda>
            {
                buddy_split(i);
c01082e6:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01082e9:	89 04 24             	mov    %eax,(%esp)
c01082ec:	e8 4d fd ff ff       	call   c010803e <buddy_split>
                break;
c01082f1:	eb 12                	jmp    c0108305 <buddy_alloc_pages+0xec>
        for(int i=order;i<max_order+1;i++)
c01082f3:	ff 45 f4             	incl   -0xc(%ebp)
c01082f6:	a1 20 da 2a c0       	mov    0xc02ada20,%eax
c01082fb:	8d 50 01             	lea    0x1(%eax),%edx
c01082fe:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108301:	39 c2                	cmp    %eax,%edx
c0108303:	77 bd                	ja     c01082c2 <buddy_alloc_pages+0xa9>
    while(list_empty(&buddy_array[order]))
c0108305:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108308:	c1 e0 03             	shl    $0x3,%eax
c010830b:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c0108310:	83 c0 04             	add    $0x4,%eax
c0108313:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0108316:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0108319:	8b 40 04             	mov    0x4(%eax),%eax
c010831c:	39 45 e0             	cmp    %eax,-0x20(%ebp)
c010831f:	0f 94 c0             	sete   %al
c0108322:	0f b6 c0             	movzbl %al,%eax
c0108325:	85 c0                	test   %eax,%eax
c0108327:	75 91                	jne    c01082ba <buddy_alloc_pages+0xa1>
            }
        }
    }
    page = le2page(list_next(&(buddy_array[order])), page_link);
c0108329:	8b 45 e8             	mov    -0x18(%ebp),%eax
c010832c:	c1 e0 03             	shl    $0x3,%eax
c010832f:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c0108334:	83 c0 04             	add    $0x4,%eax
c0108337:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return listelm->next;
c010833a:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010833d:	8b 40 04             	mov    0x4(%eax),%eax
c0108340:	83 e8 0c             	sub    $0xc,%eax
c0108343:	89 45 f0             	mov    %eax,-0x10(%ebp)
    list_del(list_next(&(buddy_array[order])));
c0108346:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108349:	c1 e0 03             	shl    $0x3,%eax
c010834c:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c0108351:	83 c0 04             	add    $0x4,%eax
c0108354:	89 45 c8             	mov    %eax,-0x38(%ebp)
c0108357:	8b 45 c8             	mov    -0x38(%ebp),%eax
c010835a:	8b 40 04             	mov    0x4(%eax),%eax
c010835d:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    __list_del(listelm->prev, listelm->next);
c0108360:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0108363:	8b 40 04             	mov    0x4(%eax),%eax
c0108366:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0108369:	8b 12                	mov    (%edx),%edx
c010836b:	89 55 d0             	mov    %edx,-0x30(%ebp)
c010836e:	89 45 cc             	mov    %eax,-0x34(%ebp)
    prev->next = next;
c0108371:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0108374:	8b 55 cc             	mov    -0x34(%ebp),%edx
c0108377:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c010837a:	8b 45 cc             	mov    -0x34(%ebp),%eax
c010837d:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0108380:	89 10                	mov    %edx,(%eax)
}
c0108382:	90                   	nop
}
c0108383:	90                   	nop
    SetPageProperty(page);
c0108384:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108387:	83 c0 04             	add    $0x4,%eax
c010838a:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
c0108391:	89 45 d8             	mov    %eax,-0x28(%ebp)
    asm volatile ("btsl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c0108394:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0108397:	8b 55 dc             	mov    -0x24(%ebp),%edx
c010839a:	0f ab 10             	bts    %edx,(%eax)
}
c010839d:	90                   	nop
    cprintf("[*]Core: Buddy array after ALLOC NO.%d page:\n", page2ppn(page));
c010839e:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01083a1:	89 04 24             	mov    %eax,(%esp)
c01083a4:	e8 3c f8 ff ff       	call   c0107be5 <page2ppn>
c01083a9:	89 44 24 04          	mov    %eax,0x4(%esp)
c01083ad:	c7 04 24 a8 ad 10 c0 	movl   $0xc010ada8,(%esp)
c01083b4:	e8 fc 7e ff ff       	call   c01002b5 <cprintf>
    show_buddy_array();
c01083b9:	e8 09 f9 ff ff       	call   c0107cc7 <show_buddy_array>
    nr_free -= pnum;
c01083be:	a1 cc da 2a c0       	mov    0xc02adacc,%eax
c01083c3:	2b 45 ec             	sub    -0x14(%ebp),%eax
c01083c6:	a3 cc da 2a c0       	mov    %eax,0xc02adacc
    cprintf("[*]Core: nr_free: %d\n", nr_free);
c01083cb:	a1 cc da 2a c0       	mov    0xc02adacc,%eax
c01083d0:	89 44 24 04          	mov    %eax,0x4(%esp)
c01083d4:	c7 04 24 d6 ad 10 c0 	movl   $0xc010add6,(%esp)
c01083db:	e8 d5 7e ff ff       	call   c01002b5 <cprintf>
    return page;
c01083e0:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
c01083e3:	c9                   	leave  
c01083e4:	c3                   	ret    

c01083e5 <buddy_free_pages>:

static void buddy_free_pages(struct Page *base, size_t n) 
{
c01083e5:	f3 0f 1e fb          	endbr32 
c01083e9:	55                   	push   %ebp
c01083ea:	89 e5                	mov    %esp,%ebp
c01083ec:	81 ec 98 00 00 00    	sub    $0x98,%esp
    assert(n > 0);
c01083f2:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c01083f6:	75 24                	jne    c010841c <buddy_free_pages+0x37>
c01083f8:	c7 44 24 0c 4c ad 10 	movl   $0xc010ad4c,0xc(%esp)
c01083ff:	c0 
c0108400:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0108407:	c0 
c0108408:	c7 44 24 04 b6 00 00 	movl   $0xb6,0x4(%esp)
c010840f:	00 
c0108410:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0108417:	e8 05 80 ff ff       	call   c0100421 <__panic>
    unsigned int pnum = 1 << (base->property);
c010841c:	8b 45 08             	mov    0x8(%ebp),%eax
c010841f:	8b 40 08             	mov    0x8(%eax),%eax
c0108422:	ba 01 00 00 00       	mov    $0x1,%edx
c0108427:	88 c1                	mov    %al,%cl
c0108429:	d3 e2                	shl    %cl,%edx
c010842b:	89 d0                	mov    %edx,%eax
c010842d:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert(FixUp(n) == pnum);
c0108430:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108433:	89 04 24             	mov    %eax,(%esp)
c0108436:	e8 0f f8 ff ff       	call   c0107c4a <FixUp>
c010843b:	39 45 ec             	cmp    %eax,-0x14(%ebp)
c010843e:	74 24                	je     c0108464 <buddy_free_pages+0x7f>
c0108440:	c7 44 24 0c ec ad 10 	movl   $0xc010adec,0xc(%esp)
c0108447:	c0 
c0108448:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c010844f:	c0 
c0108450:	c7 44 24 04 b8 00 00 	movl   $0xb8,0x4(%esp)
c0108457:	00 
c0108458:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c010845f:	e8 bd 7f ff ff       	call   c0100421 <__panic>
    cprintf("[*]Core: Freeing NO.%d page leading %d pages block: \n", page2ppn(base), pnum);
c0108464:	8b 45 08             	mov    0x8(%ebp),%eax
c0108467:	89 04 24             	mov    %eax,(%esp)
c010846a:	e8 76 f7 ff ff       	call   c0107be5 <page2ppn>
c010846f:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0108472:	89 54 24 08          	mov    %edx,0x8(%esp)
c0108476:	89 44 24 04          	mov    %eax,0x4(%esp)
c010847a:	c7 04 24 00 ae 10 c0 	movl   $0xc010ae00,(%esp)
c0108481:	e8 2f 7e ff ff       	call   c01002b5 <cprintf>
    struct Page* left_block = base;
c0108486:	8b 45 08             	mov    0x8(%ebp),%eax
c0108489:	89 45 f4             	mov    %eax,-0xc(%ebp)
    struct Page* buddy = NULL;
c010848c:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
    struct Page* tmp = NULL;
c0108493:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)

    buddy = buddy_find(left_block);
c010849a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010849d:	89 04 24             	mov    %eax,(%esp)
c01084a0:	e8 cf fa ff ff       	call   c0107f74 <buddy_find>
c01084a5:	89 45 f0             	mov    %eax,-0x10(%ebp)
    list_add(&(buddy_array[left_block->property]), &(left_block->page_link));
c01084a8:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01084ab:	8d 50 0c             	lea    0xc(%eax),%edx
c01084ae:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01084b1:	8b 40 08             	mov    0x8(%eax),%eax
c01084b4:	c1 e0 03             	shl    $0x3,%eax
c01084b7:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c01084bc:	83 c0 04             	add    $0x4,%eax
c01084bf:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c01084c2:	89 55 e0             	mov    %edx,-0x20(%ebp)
c01084c5:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c01084c8:	89 45 dc             	mov    %eax,-0x24(%ebp)
c01084cb:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01084ce:	89 45 d8             	mov    %eax,-0x28(%ebp)
    __list_add(elm, listelm, listelm->next);
c01084d1:	8b 45 dc             	mov    -0x24(%ebp),%eax
c01084d4:	8b 40 04             	mov    0x4(%eax),%eax
c01084d7:	8b 55 d8             	mov    -0x28(%ebp),%edx
c01084da:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c01084dd:	8b 55 dc             	mov    -0x24(%ebp),%edx
c01084e0:	89 55 d0             	mov    %edx,-0x30(%ebp)
c01084e3:	89 45 cc             	mov    %eax,-0x34(%ebp)
    prev->next = next->prev = elm;
c01084e6:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01084e9:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c01084ec:	89 10                	mov    %edx,(%eax)
c01084ee:	8b 45 cc             	mov    -0x34(%ebp),%eax
c01084f1:	8b 10                	mov    (%eax),%edx
c01084f3:	8b 45 d0             	mov    -0x30(%ebp),%eax
c01084f6:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c01084f9:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c01084fc:	8b 55 cc             	mov    -0x34(%ebp),%edx
c01084ff:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c0108502:	8b 45 d4             	mov    -0x2c(%ebp),%eax
c0108505:	8b 55 d0             	mov    -0x30(%ebp),%edx
c0108508:	89 10                	mov    %edx,(%eax)
}
c010850a:	90                   	nop
}
c010850b:	90                   	nop
}
c010850c:	90                   	nop
    cprintf("[*]Core: add to list\n");
c010850d:	c7 04 24 36 ae 10 c0 	movl   $0xc010ae36,(%esp)
c0108514:	e8 9c 7d ff ff       	call   c01002b5 <cprintf>
    //show_buddy_array();
    while (!PageProperty(buddy) && left_block->property < max_order) 
c0108519:	e9 2b 01 00 00       	jmp    c0108649 <buddy_free_pages+0x264>
    {
        cprintf("[*]Core: Buddy free, MERGING!\n");
c010851e:	c7 04 24 4c ae 10 c0 	movl   $0xc010ae4c,(%esp)
c0108525:	e8 8b 7d ff ff       	call   c01002b5 <cprintf>
        if (left_block > buddy)//buddy is on the left
c010852a:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010852d:	3b 45 f0             	cmp    -0x10(%ebp),%eax
c0108530:	76 36                	jbe    c0108568 <buddy_free_pages+0x183>
         {
            left_block->property = -1;
c0108532:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108535:	c7 40 08 ff ff ff ff 	movl   $0xffffffff,0x8(%eax)
            ClearPageProperty(left_block);
c010853c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010853f:	83 c0 04             	add    $0x4,%eax
c0108542:	c7 45 c8 01 00 00 00 	movl   $0x1,-0x38(%ebp)
c0108549:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c010854c:	8b 45 c4             	mov    -0x3c(%ebp),%eax
c010854f:	8b 55 c8             	mov    -0x38(%ebp),%edx
c0108552:	0f b3 10             	btr    %edx,(%eax)
}
c0108555:	90                   	nop
            //redefine the "left"
            tmp = left_block;
c0108556:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108559:	89 45 e8             	mov    %eax,-0x18(%ebp)
            left_block = buddy;
c010855c:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010855f:	89 45 f4             	mov    %eax,-0xc(%ebp)
            buddy = tmp;
c0108562:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108565:	89 45 f0             	mov    %eax,-0x10(%ebp)
        }
        list_del(&(left_block->page_link));    
c0108568:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010856b:	83 c0 0c             	add    $0xc,%eax
c010856e:	89 45 98             	mov    %eax,-0x68(%ebp)
    __list_del(listelm->prev, listelm->next);
c0108571:	8b 45 98             	mov    -0x68(%ebp),%eax
c0108574:	8b 40 04             	mov    0x4(%eax),%eax
c0108577:	8b 55 98             	mov    -0x68(%ebp),%edx
c010857a:	8b 12                	mov    (%edx),%edx
c010857c:	89 55 94             	mov    %edx,-0x6c(%ebp)
c010857f:	89 45 90             	mov    %eax,-0x70(%ebp)
    prev->next = next;
c0108582:	8b 45 94             	mov    -0x6c(%ebp),%eax
c0108585:	8b 55 90             	mov    -0x70(%ebp),%edx
c0108588:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c010858b:	8b 45 90             	mov    -0x70(%ebp),%eax
c010858e:	8b 55 94             	mov    -0x6c(%ebp),%edx
c0108591:	89 10                	mov    %edx,(%eax)
}
c0108593:	90                   	nop
}
c0108594:	90                   	nop
        list_del(&(buddy->page_link));
c0108595:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108598:	83 c0 0c             	add    $0xc,%eax
c010859b:	89 45 a4             	mov    %eax,-0x5c(%ebp)
    __list_del(listelm->prev, listelm->next);
c010859e:	8b 45 a4             	mov    -0x5c(%ebp),%eax
c01085a1:	8b 40 04             	mov    0x4(%eax),%eax
c01085a4:	8b 55 a4             	mov    -0x5c(%ebp),%edx
c01085a7:	8b 12                	mov    (%edx),%edx
c01085a9:	89 55 a0             	mov    %edx,-0x60(%ebp)
c01085ac:	89 45 9c             	mov    %eax,-0x64(%ebp)
    prev->next = next;
c01085af:	8b 45 a0             	mov    -0x60(%ebp),%eax
c01085b2:	8b 55 9c             	mov    -0x64(%ebp),%edx
c01085b5:	89 50 04             	mov    %edx,0x4(%eax)
    next->prev = prev;
c01085b8:	8b 45 9c             	mov    -0x64(%ebp),%eax
c01085bb:	8b 55 a0             	mov    -0x60(%ebp),%edx
c01085be:	89 10                	mov    %edx,(%eax)
}
c01085c0:	90                   	nop
}
c01085c1:	90                   	nop
        left_block->property += 1;
c01085c2:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01085c5:	8b 40 08             	mov    0x8(%eax),%eax
c01085c8:	8d 50 01             	lea    0x1(%eax),%edx
c01085cb:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01085ce:	89 50 08             	mov    %edx,0x8(%eax)
        list_add(&(buddy_array[left_block->property]), &(left_block->page_link));
c01085d1:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01085d4:	8d 50 0c             	lea    0xc(%eax),%edx
c01085d7:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01085da:	8b 40 08             	mov    0x8(%eax),%eax
c01085dd:	c1 e0 03             	shl    $0x3,%eax
c01085e0:	05 20 da 2a c0       	add    $0xc02ada20,%eax
c01085e5:	83 c0 04             	add    $0x4,%eax
c01085e8:	89 45 c0             	mov    %eax,-0x40(%ebp)
c01085eb:	89 55 bc             	mov    %edx,-0x44(%ebp)
c01085ee:	8b 45 c0             	mov    -0x40(%ebp),%eax
c01085f1:	89 45 b8             	mov    %eax,-0x48(%ebp)
c01085f4:	8b 45 bc             	mov    -0x44(%ebp),%eax
c01085f7:	89 45 b4             	mov    %eax,-0x4c(%ebp)
    __list_add(elm, listelm, listelm->next);
c01085fa:	8b 45 b8             	mov    -0x48(%ebp),%eax
c01085fd:	8b 40 04             	mov    0x4(%eax),%eax
c0108600:	8b 55 b4             	mov    -0x4c(%ebp),%edx
c0108603:	89 55 b0             	mov    %edx,-0x50(%ebp)
c0108606:	8b 55 b8             	mov    -0x48(%ebp),%edx
c0108609:	89 55 ac             	mov    %edx,-0x54(%ebp)
c010860c:	89 45 a8             	mov    %eax,-0x58(%ebp)
    prev->next = next->prev = elm;
c010860f:	8b 45 a8             	mov    -0x58(%ebp),%eax
c0108612:	8b 55 b0             	mov    -0x50(%ebp),%edx
c0108615:	89 10                	mov    %edx,(%eax)
c0108617:	8b 45 a8             	mov    -0x58(%ebp),%eax
c010861a:	8b 10                	mov    (%eax),%edx
c010861c:	8b 45 ac             	mov    -0x54(%ebp),%eax
c010861f:	89 50 04             	mov    %edx,0x4(%eax)
    elm->next = next;
c0108622:	8b 45 b0             	mov    -0x50(%ebp),%eax
c0108625:	8b 55 a8             	mov    -0x58(%ebp),%edx
c0108628:	89 50 04             	mov    %edx,0x4(%eax)
    elm->prev = prev;
c010862b:	8b 45 b0             	mov    -0x50(%ebp),%eax
c010862e:	8b 55 ac             	mov    -0x54(%ebp),%edx
c0108631:	89 10                	mov    %edx,(%eax)
}
c0108633:	90                   	nop
}
c0108634:	90                   	nop
}
c0108635:	90                   	nop
        show_buddy_array();
c0108636:	e8 8c f6 ff ff       	call   c0107cc7 <show_buddy_array>
        buddy = buddy_find(left_block);
c010863b:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010863e:	89 04 24             	mov    %eax,(%esp)
c0108641:	e8 2e f9 ff ff       	call   c0107f74 <buddy_find>
c0108646:	89 45 f0             	mov    %eax,-0x10(%ebp)
    while (!PageProperty(buddy) && left_block->property < max_order) 
c0108649:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010864c:	83 c0 04             	add    $0x4,%eax
c010864f:	c7 45 8c 01 00 00 00 	movl   $0x1,-0x74(%ebp)
c0108656:	89 45 88             	mov    %eax,-0x78(%ebp)
    asm volatile ("btl %2, %1; sbbl %0,%0" : "=r" (oldbit) : "m" (*(volatile long *)addr), "Ir" (nr));
c0108659:	8b 45 88             	mov    -0x78(%ebp),%eax
c010865c:	8b 55 8c             	mov    -0x74(%ebp),%edx
c010865f:	0f a3 10             	bt     %edx,(%eax)
c0108662:	19 c0                	sbb    %eax,%eax
c0108664:	89 45 84             	mov    %eax,-0x7c(%ebp)
    return oldbit != 0;
c0108667:	83 7d 84 00          	cmpl   $0x0,-0x7c(%ebp)
c010866b:	0f 95 c0             	setne  %al
c010866e:	0f b6 c0             	movzbl %al,%eax
c0108671:	85 c0                	test   %eax,%eax
c0108673:	75 13                	jne    c0108688 <buddy_free_pages+0x2a3>
c0108675:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108678:	8b 50 08             	mov    0x8(%eax),%edx
c010867b:	a1 20 da 2a c0       	mov    0xc02ada20,%eax
c0108680:	39 c2                	cmp    %eax,%edx
c0108682:	0f 82 96 fe ff ff    	jb     c010851e <buddy_free_pages+0x139>
    }
    cprintf("[*]Core: Buddy array after FREE:\n");
c0108688:	c7 04 24 6c ae 10 c0 	movl   $0xc010ae6c,(%esp)
c010868f:	e8 21 7c ff ff       	call   c01002b5 <cprintf>
    ClearPageProperty(left_block);
c0108694:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108697:	83 c0 04             	add    $0x4,%eax
c010869a:	c7 45 80 01 00 00 00 	movl   $0x1,-0x80(%ebp)
c01086a1:	89 85 7c ff ff ff    	mov    %eax,-0x84(%ebp)
    asm volatile ("btrl %1, %0" :"=m" (*(volatile long *)addr) : "Ir" (nr));
c01086a7:	8b 85 7c ff ff ff    	mov    -0x84(%ebp),%eax
c01086ad:	8b 55 80             	mov    -0x80(%ebp),%edx
c01086b0:	0f b3 10             	btr    %edx,(%eax)
}
c01086b3:	90                   	nop
    nr_free += pnum;
c01086b4:	8b 15 cc da 2a c0    	mov    0xc02adacc,%edx
c01086ba:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01086bd:	01 d0                	add    %edx,%eax
c01086bf:	a3 cc da 2a c0       	mov    %eax,0xc02adacc
    show_buddy_array();
c01086c4:	e8 fe f5 ff ff       	call   c0107cc7 <show_buddy_array>
    
    cprintf("[*]Core: nr_free: %d\n", nr_free);
c01086c9:	a1 cc da 2a c0       	mov    0xc02adacc,%eax
c01086ce:	89 44 24 04          	mov    %eax,0x4(%esp)
c01086d2:	c7 04 24 d6 ad 10 c0 	movl   $0xc010add6,(%esp)
c01086d9:	e8 d7 7b ff ff       	call   c01002b5 <cprintf>
    return;
c01086de:	90                   	nop
}
c01086df:	c9                   	leave  
c01086e0:	c3                   	ret    

c01086e1 <buddy_nr_free_pages>:

static size_t buddy_nr_free_pages(void) 
{
c01086e1:	f3 0f 1e fb          	endbr32 
c01086e5:	55                   	push   %ebp
c01086e6:	89 e5                	mov    %esp,%ebp
    return nr_free;
c01086e8:	a1 cc da 2a c0       	mov    0xc02adacc,%eax
}
c01086ed:	5d                   	pop    %ebp
c01086ee:	c3                   	ret    

c01086ef <basic_check>:

static void basic_check(void) 
{
c01086ef:	f3 0f 1e fb          	endbr32 
c01086f3:	55                   	push   %ebp
c01086f4:	89 e5                	mov    %esp,%ebp
c01086f6:	83 ec 28             	sub    $0x28,%esp
    struct Page *p0, *p1, *p2;
    p0 = p1 = p2 = NULL;
c01086f9:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
c0108700:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108703:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108706:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108709:	89 45 ec             	mov    %eax,-0x14(%ebp)
    assert((p0 = alloc_page()) != NULL);
c010870c:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0108713:	e8 bf b6 ff ff       	call   c0103dd7 <alloc_pages>
c0108718:	89 45 ec             	mov    %eax,-0x14(%ebp)
c010871b:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c010871f:	75 24                	jne    c0108745 <basic_check+0x56>
c0108721:	c7 44 24 0c 8e ae 10 	movl   $0xc010ae8e,0xc(%esp)
c0108728:	c0 
c0108729:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0108730:	c0 
c0108731:	c7 44 24 04 e7 00 00 	movl   $0xe7,0x4(%esp)
c0108738:	00 
c0108739:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0108740:	e8 dc 7c ff ff       	call   c0100421 <__panic>
    assert((p1 = alloc_page()) != NULL);
c0108745:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010874c:	e8 86 b6 ff ff       	call   c0103dd7 <alloc_pages>
c0108751:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108754:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0108758:	75 24                	jne    c010877e <basic_check+0x8f>
c010875a:	c7 44 24 0c aa ae 10 	movl   $0xc010aeaa,0xc(%esp)
c0108761:	c0 
c0108762:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0108769:	c0 
c010876a:	c7 44 24 04 e8 00 00 	movl   $0xe8,0x4(%esp)
c0108771:	00 
c0108772:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0108779:	e8 a3 7c ff ff       	call   c0100421 <__panic>
    assert((p2 = alloc_page()) != NULL);
c010877e:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c0108785:	e8 4d b6 ff ff       	call   c0103dd7 <alloc_pages>
c010878a:	89 45 f4             	mov    %eax,-0xc(%ebp)
c010878d:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c0108791:	75 24                	jne    c01087b7 <basic_check+0xc8>
c0108793:	c7 44 24 0c c6 ae 10 	movl   $0xc010aec6,0xc(%esp)
c010879a:	c0 
c010879b:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c01087a2:	c0 
c01087a3:	c7 44 24 04 e9 00 00 	movl   $0xe9,0x4(%esp)
c01087aa:	00 
c01087ab:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c01087b2:	e8 6a 7c ff ff       	call   c0100421 <__panic>
    free_page(p0);
c01087b7:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01087be:	00 
c01087bf:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01087c2:	89 04 24             	mov    %eax,(%esp)
c01087c5:	e8 49 b6 ff ff       	call   c0103e13 <free_pages>
    free_page(p1);
c01087ca:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01087d1:	00 
c01087d2:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01087d5:	89 04 24             	mov    %eax,(%esp)
c01087d8:	e8 36 b6 ff ff       	call   c0103e13 <free_pages>
    free_page(p2);
c01087dd:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01087e4:	00 
c01087e5:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01087e8:	89 04 24             	mov    %eax,(%esp)
c01087eb:	e8 23 b6 ff ff       	call   c0103e13 <free_pages>
    show_buddy_array();
c01087f0:	e8 d2 f4 ff ff       	call   c0107cc7 <show_buddy_array>

    assert((p0 = alloc_pages(4)) != NULL);
c01087f5:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
c01087fc:	e8 d6 b5 ff ff       	call   c0103dd7 <alloc_pages>
c0108801:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0108804:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c0108808:	75 24                	jne    c010882e <basic_check+0x13f>
c010880a:	c7 44 24 0c e2 ae 10 	movl   $0xc010aee2,0xc(%esp)
c0108811:	c0 
c0108812:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0108819:	c0 
c010881a:	c7 44 24 04 ef 00 00 	movl   $0xef,0x4(%esp)
c0108821:	00 
c0108822:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0108829:	e8 f3 7b ff ff       	call   c0100421 <__panic>
    assert((p1 = alloc_pages(2)) != NULL);
c010882e:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
c0108835:	e8 9d b5 ff ff       	call   c0103dd7 <alloc_pages>
c010883a:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010883d:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0108841:	75 24                	jne    c0108867 <basic_check+0x178>
c0108843:	c7 44 24 0c 00 af 10 	movl   $0xc010af00,0xc(%esp)
c010884a:	c0 
c010884b:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0108852:	c0 
c0108853:	c7 44 24 04 f0 00 00 	movl   $0xf0,0x4(%esp)
c010885a:	00 
c010885b:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0108862:	e8 ba 7b ff ff       	call   c0100421 <__panic>
    assert((p2 = alloc_pages(1)) != NULL);
c0108867:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
c010886e:	e8 64 b5 ff ff       	call   c0103dd7 <alloc_pages>
c0108873:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0108876:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
c010887a:	75 24                	jne    c01088a0 <basic_check+0x1b1>
c010887c:	c7 44 24 0c 1e af 10 	movl   $0xc010af1e,0xc(%esp)
c0108883:	c0 
c0108884:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c010888b:	c0 
c010888c:	c7 44 24 04 f1 00 00 	movl   $0xf1,0x4(%esp)
c0108893:	00 
c0108894:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c010889b:	e8 81 7b ff ff       	call   c0100421 <__panic>
    free_pages(p0, 4);
c01088a0:	c7 44 24 04 04 00 00 	movl   $0x4,0x4(%esp)
c01088a7:	00 
c01088a8:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01088ab:	89 04 24             	mov    %eax,(%esp)
c01088ae:	e8 60 b5 ff ff       	call   c0103e13 <free_pages>
    free_pages(p1, 2);
c01088b3:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
c01088ba:	00 
c01088bb:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01088be:	89 04 24             	mov    %eax,(%esp)
c01088c1:	e8 4d b5 ff ff       	call   c0103e13 <free_pages>
    free_pages(p2, 1);
c01088c6:	c7 44 24 04 01 00 00 	movl   $0x1,0x4(%esp)
c01088cd:	00 
c01088ce:	8b 45 f4             	mov    -0xc(%ebp),%eax
c01088d1:	89 04 24             	mov    %eax,(%esp)
c01088d4:	e8 3a b5 ff ff       	call   c0103e13 <free_pages>
    show_buddy_array();
c01088d9:	e8 e9 f3 ff ff       	call   c0107cc7 <show_buddy_array>

    assert((p0 = alloc_pages(3)) != NULL);
c01088de:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
c01088e5:	e8 ed b4 ff ff       	call   c0103dd7 <alloc_pages>
c01088ea:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01088ed:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
c01088f1:	75 24                	jne    c0108917 <basic_check+0x228>
c01088f3:	c7 44 24 0c 3c af 10 	movl   $0xc010af3c,0xc(%esp)
c01088fa:	c0 
c01088fb:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c0108902:	c0 
c0108903:	c7 44 24 04 f7 00 00 	movl   $0xf7,0x4(%esp)
c010890a:	00 
c010890b:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c0108912:	e8 0a 7b ff ff       	call   c0100421 <__panic>
    assert((p1 = alloc_pages(3)) != NULL);
c0108917:	c7 04 24 03 00 00 00 	movl   $0x3,(%esp)
c010891e:	e8 b4 b4 ff ff       	call   c0103dd7 <alloc_pages>
c0108923:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108926:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c010892a:	75 24                	jne    c0108950 <basic_check+0x261>
c010892c:	c7 44 24 0c 5a af 10 	movl   $0xc010af5a,0xc(%esp)
c0108933:	c0 
c0108934:	c7 44 24 08 47 ac 10 	movl   $0xc010ac47,0x8(%esp)
c010893b:	c0 
c010893c:	c7 44 24 04 f8 00 00 	movl   $0xf8,0x4(%esp)
c0108943:	00 
c0108944:	c7 04 24 5c ac 10 c0 	movl   $0xc010ac5c,(%esp)
c010894b:	e8 d1 7a ff ff       	call   c0100421 <__panic>
    free_pages(p0, 3);
c0108950:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c0108957:	00 
c0108958:	8b 45 ec             	mov    -0x14(%ebp),%eax
c010895b:	89 04 24             	mov    %eax,(%esp)
c010895e:	e8 b0 b4 ff ff       	call   c0103e13 <free_pages>
    free_pages(p1, 3);
c0108963:	c7 44 24 04 03 00 00 	movl   $0x3,0x4(%esp)
c010896a:	00 
c010896b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c010896e:	89 04 24             	mov    %eax,(%esp)
c0108971:	e8 9d b4 ff ff       	call   c0103e13 <free_pages>

    show_buddy_array();
c0108976:	e8 4c f3 ff ff       	call   c0107cc7 <show_buddy_array>
    cprintf("buddy_check success!");
c010897b:	c7 04 24 78 af 10 c0 	movl   $0xc010af78,(%esp)
c0108982:	e8 2e 79 ff ff       	call   c01002b5 <cprintf>
}
c0108987:	90                   	nop
c0108988:	c9                   	leave  
c0108989:	c3                   	ret    

c010898a <buddy_check>:

static void buddy_check(void) 
{
c010898a:	f3 0f 1e fb          	endbr32 
c010898e:	55                   	push   %ebp
c010898f:	89 e5                	mov    %esp,%ebp
c0108991:	83 ec 08             	sub    $0x8,%esp
    basic_check();
c0108994:	e8 56 fd ff ff       	call   c01086ef <basic_check>
}
c0108999:	90                   	nop
c010899a:	c9                   	leave  
c010899b:	c3                   	ret    

c010899c <strlen>:
 * @s:      the input string
 *
 * The strlen() function returns the length of string @s.
 * */
size_t
strlen(const char *s) {
c010899c:	f3 0f 1e fb          	endbr32 
c01089a0:	55                   	push   %ebp
c01089a1:	89 e5                	mov    %esp,%ebp
c01089a3:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c01089a6:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (*s ++ != '\0') {
c01089ad:	eb 03                	jmp    c01089b2 <strlen+0x16>
        cnt ++;
c01089af:	ff 45 fc             	incl   -0x4(%ebp)
    while (*s ++ != '\0') {
c01089b2:	8b 45 08             	mov    0x8(%ebp),%eax
c01089b5:	8d 50 01             	lea    0x1(%eax),%edx
c01089b8:	89 55 08             	mov    %edx,0x8(%ebp)
c01089bb:	0f b6 00             	movzbl (%eax),%eax
c01089be:	84 c0                	test   %al,%al
c01089c0:	75 ed                	jne    c01089af <strlen+0x13>
    }
    return cnt;
c01089c2:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01089c5:	c9                   	leave  
c01089c6:	c3                   	ret    

c01089c7 <strnlen>:
 * The return value is strlen(s), if that is less than @len, or
 * @len if there is no '\0' character among the first @len characters
 * pointed by @s.
 * */
size_t
strnlen(const char *s, size_t len) {
c01089c7:	f3 0f 1e fb          	endbr32 
c01089cb:	55                   	push   %ebp
c01089cc:	89 e5                	mov    %esp,%ebp
c01089ce:	83 ec 10             	sub    $0x10,%esp
    size_t cnt = 0;
c01089d1:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c01089d8:	eb 03                	jmp    c01089dd <strnlen+0x16>
        cnt ++;
c01089da:	ff 45 fc             	incl   -0x4(%ebp)
    while (cnt < len && *s ++ != '\0') {
c01089dd:	8b 45 fc             	mov    -0x4(%ebp),%eax
c01089e0:	3b 45 0c             	cmp    0xc(%ebp),%eax
c01089e3:	73 10                	jae    c01089f5 <strnlen+0x2e>
c01089e5:	8b 45 08             	mov    0x8(%ebp),%eax
c01089e8:	8d 50 01             	lea    0x1(%eax),%edx
c01089eb:	89 55 08             	mov    %edx,0x8(%ebp)
c01089ee:	0f b6 00             	movzbl (%eax),%eax
c01089f1:	84 c0                	test   %al,%al
c01089f3:	75 e5                	jne    c01089da <strnlen+0x13>
    }
    return cnt;
c01089f5:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
c01089f8:	c9                   	leave  
c01089f9:	c3                   	ret    

c01089fa <strcpy>:
 * To avoid overflows, the size of array pointed by @dst should be long enough to
 * contain the same string as @src (including the terminating null character), and
 * should not overlap in memory with @src.
 * */
char *
strcpy(char *dst, const char *src) {
c01089fa:	f3 0f 1e fb          	endbr32 
c01089fe:	55                   	push   %ebp
c01089ff:	89 e5                	mov    %esp,%ebp
c0108a01:	57                   	push   %edi
c0108a02:	56                   	push   %esi
c0108a03:	83 ec 20             	sub    $0x20,%esp
c0108a06:	8b 45 08             	mov    0x8(%ebp),%eax
c0108a09:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0108a0c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108a0f:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_STRCPY
#define __HAVE_ARCH_STRCPY
static inline char *
__strcpy(char *dst, const char *src) {
    int d0, d1, d2;
    asm volatile (
c0108a12:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0108a15:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108a18:	89 d1                	mov    %edx,%ecx
c0108a1a:	89 c2                	mov    %eax,%edx
c0108a1c:	89 ce                	mov    %ecx,%esi
c0108a1e:	89 d7                	mov    %edx,%edi
c0108a20:	ac                   	lods   %ds:(%esi),%al
c0108a21:	aa                   	stos   %al,%es:(%edi)
c0108a22:	84 c0                	test   %al,%al
c0108a24:	75 fa                	jne    c0108a20 <strcpy+0x26>
c0108a26:	89 fa                	mov    %edi,%edx
c0108a28:	89 f1                	mov    %esi,%ecx
c0108a2a:	89 4d ec             	mov    %ecx,-0x14(%ebp)
c0108a2d:	89 55 e8             	mov    %edx,-0x18(%ebp)
c0108a30:	89 45 e4             	mov    %eax,-0x1c(%ebp)
        "stosb;"
        "testb %%al, %%al;"
        "jne 1b;"
        : "=&S" (d0), "=&D" (d1), "=&a" (d2)
        : "0" (src), "1" (dst) : "memory");
    return dst;
c0108a33:	8b 45 f4             	mov    -0xc(%ebp),%eax
    char *p = dst;
    while ((*p ++ = *src ++) != '\0')
        /* nothing */;
    return dst;
#endif /* __HAVE_ARCH_STRCPY */
}
c0108a36:	83 c4 20             	add    $0x20,%esp
c0108a39:	5e                   	pop    %esi
c0108a3a:	5f                   	pop    %edi
c0108a3b:	5d                   	pop    %ebp
c0108a3c:	c3                   	ret    

c0108a3d <strncpy>:
 * @len:    maximum number of characters to be copied from @src
 *
 * The return value is @dst
 * */
char *
strncpy(char *dst, const char *src, size_t len) {
c0108a3d:	f3 0f 1e fb          	endbr32 
c0108a41:	55                   	push   %ebp
c0108a42:	89 e5                	mov    %esp,%ebp
c0108a44:	83 ec 10             	sub    $0x10,%esp
    char *p = dst;
c0108a47:	8b 45 08             	mov    0x8(%ebp),%eax
c0108a4a:	89 45 fc             	mov    %eax,-0x4(%ebp)
    while (len > 0) {
c0108a4d:	eb 1e                	jmp    c0108a6d <strncpy+0x30>
        if ((*p = *src) != '\0') {
c0108a4f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108a52:	0f b6 10             	movzbl (%eax),%edx
c0108a55:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0108a58:	88 10                	mov    %dl,(%eax)
c0108a5a:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0108a5d:	0f b6 00             	movzbl (%eax),%eax
c0108a60:	84 c0                	test   %al,%al
c0108a62:	74 03                	je     c0108a67 <strncpy+0x2a>
            src ++;
c0108a64:	ff 45 0c             	incl   0xc(%ebp)
        }
        p ++, len --;
c0108a67:	ff 45 fc             	incl   -0x4(%ebp)
c0108a6a:	ff 4d 10             	decl   0x10(%ebp)
    while (len > 0) {
c0108a6d:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0108a71:	75 dc                	jne    c0108a4f <strncpy+0x12>
    }
    return dst;
c0108a73:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0108a76:	c9                   	leave  
c0108a77:	c3                   	ret    

c0108a78 <strcmp>:
 * - A value greater than zero indicates that the first character that does
 *   not match has a greater value in @s1 than in @s2;
 * - And a value less than zero indicates the opposite.
 * */
int
strcmp(const char *s1, const char *s2) {
c0108a78:	f3 0f 1e fb          	endbr32 
c0108a7c:	55                   	push   %ebp
c0108a7d:	89 e5                	mov    %esp,%ebp
c0108a7f:	57                   	push   %edi
c0108a80:	56                   	push   %esi
c0108a81:	83 ec 20             	sub    $0x20,%esp
c0108a84:	8b 45 08             	mov    0x8(%ebp),%eax
c0108a87:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0108a8a:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108a8d:	89 45 f0             	mov    %eax,-0x10(%ebp)
    asm volatile (
c0108a90:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0108a93:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108a96:	89 d1                	mov    %edx,%ecx
c0108a98:	89 c2                	mov    %eax,%edx
c0108a9a:	89 ce                	mov    %ecx,%esi
c0108a9c:	89 d7                	mov    %edx,%edi
c0108a9e:	ac                   	lods   %ds:(%esi),%al
c0108a9f:	ae                   	scas   %es:(%edi),%al
c0108aa0:	75 08                	jne    c0108aaa <strcmp+0x32>
c0108aa2:	84 c0                	test   %al,%al
c0108aa4:	75 f8                	jne    c0108a9e <strcmp+0x26>
c0108aa6:	31 c0                	xor    %eax,%eax
c0108aa8:	eb 04                	jmp    c0108aae <strcmp+0x36>
c0108aaa:	19 c0                	sbb    %eax,%eax
c0108aac:	0c 01                	or     $0x1,%al
c0108aae:	89 fa                	mov    %edi,%edx
c0108ab0:	89 f1                	mov    %esi,%ecx
c0108ab2:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0108ab5:	89 4d e8             	mov    %ecx,-0x18(%ebp)
c0108ab8:	89 55 e4             	mov    %edx,-0x1c(%ebp)
    return ret;
c0108abb:	8b 45 ec             	mov    -0x14(%ebp),%eax
    while (*s1 != '\0' && *s1 == *s2) {
        s1 ++, s2 ++;
    }
    return (int)((unsigned char)*s1 - (unsigned char)*s2);
#endif /* __HAVE_ARCH_STRCMP */
}
c0108abe:	83 c4 20             	add    $0x20,%esp
c0108ac1:	5e                   	pop    %esi
c0108ac2:	5f                   	pop    %edi
c0108ac3:	5d                   	pop    %ebp
c0108ac4:	c3                   	ret    

c0108ac5 <strncmp>:
 * they are equal to each other, it continues with the following pairs until
 * the characters differ, until a terminating null-character is reached, or
 * until @n characters match in both strings, whichever happens first.
 * */
int
strncmp(const char *s1, const char *s2, size_t n) {
c0108ac5:	f3 0f 1e fb          	endbr32 
c0108ac9:	55                   	push   %ebp
c0108aca:	89 e5                	mov    %esp,%ebp
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0108acc:	eb 09                	jmp    c0108ad7 <strncmp+0x12>
        n --, s1 ++, s2 ++;
c0108ace:	ff 4d 10             	decl   0x10(%ebp)
c0108ad1:	ff 45 08             	incl   0x8(%ebp)
c0108ad4:	ff 45 0c             	incl   0xc(%ebp)
    while (n > 0 && *s1 != '\0' && *s1 == *s2) {
c0108ad7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0108adb:	74 1a                	je     c0108af7 <strncmp+0x32>
c0108add:	8b 45 08             	mov    0x8(%ebp),%eax
c0108ae0:	0f b6 00             	movzbl (%eax),%eax
c0108ae3:	84 c0                	test   %al,%al
c0108ae5:	74 10                	je     c0108af7 <strncmp+0x32>
c0108ae7:	8b 45 08             	mov    0x8(%ebp),%eax
c0108aea:	0f b6 10             	movzbl (%eax),%edx
c0108aed:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108af0:	0f b6 00             	movzbl (%eax),%eax
c0108af3:	38 c2                	cmp    %al,%dl
c0108af5:	74 d7                	je     c0108ace <strncmp+0x9>
    }
    return (n == 0) ? 0 : (int)((unsigned char)*s1 - (unsigned char)*s2);
c0108af7:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0108afb:	74 18                	je     c0108b15 <strncmp+0x50>
c0108afd:	8b 45 08             	mov    0x8(%ebp),%eax
c0108b00:	0f b6 00             	movzbl (%eax),%eax
c0108b03:	0f b6 d0             	movzbl %al,%edx
c0108b06:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108b09:	0f b6 00             	movzbl (%eax),%eax
c0108b0c:	0f b6 c0             	movzbl %al,%eax
c0108b0f:	29 c2                	sub    %eax,%edx
c0108b11:	89 d0                	mov    %edx,%eax
c0108b13:	eb 05                	jmp    c0108b1a <strncmp+0x55>
c0108b15:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0108b1a:	5d                   	pop    %ebp
c0108b1b:	c3                   	ret    

c0108b1c <strchr>:
 *
 * The strchr() function returns a pointer to the first occurrence of
 * character in @s. If the value is not found, the function returns 'NULL'.
 * */
char *
strchr(const char *s, char c) {
c0108b1c:	f3 0f 1e fb          	endbr32 
c0108b20:	55                   	push   %ebp
c0108b21:	89 e5                	mov    %esp,%ebp
c0108b23:	83 ec 04             	sub    $0x4,%esp
c0108b26:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108b29:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0108b2c:	eb 13                	jmp    c0108b41 <strchr+0x25>
        if (*s == c) {
c0108b2e:	8b 45 08             	mov    0x8(%ebp),%eax
c0108b31:	0f b6 00             	movzbl (%eax),%eax
c0108b34:	38 45 fc             	cmp    %al,-0x4(%ebp)
c0108b37:	75 05                	jne    c0108b3e <strchr+0x22>
            return (char *)s;
c0108b39:	8b 45 08             	mov    0x8(%ebp),%eax
c0108b3c:	eb 12                	jmp    c0108b50 <strchr+0x34>
        }
        s ++;
c0108b3e:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
c0108b41:	8b 45 08             	mov    0x8(%ebp),%eax
c0108b44:	0f b6 00             	movzbl (%eax),%eax
c0108b47:	84 c0                	test   %al,%al
c0108b49:	75 e3                	jne    c0108b2e <strchr+0x12>
    }
    return NULL;
c0108b4b:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0108b50:	c9                   	leave  
c0108b51:	c3                   	ret    

c0108b52 <strfind>:
 * The strfind() function is like strchr() except that if @c is
 * not found in @s, then it returns a pointer to the null byte at the
 * end of @s, rather than 'NULL'.
 * */
char *
strfind(const char *s, char c) {
c0108b52:	f3 0f 1e fb          	endbr32 
c0108b56:	55                   	push   %ebp
c0108b57:	89 e5                	mov    %esp,%ebp
c0108b59:	83 ec 04             	sub    $0x4,%esp
c0108b5c:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108b5f:	88 45 fc             	mov    %al,-0x4(%ebp)
    while (*s != '\0') {
c0108b62:	eb 0e                	jmp    c0108b72 <strfind+0x20>
        if (*s == c) {
c0108b64:	8b 45 08             	mov    0x8(%ebp),%eax
c0108b67:	0f b6 00             	movzbl (%eax),%eax
c0108b6a:	38 45 fc             	cmp    %al,-0x4(%ebp)
c0108b6d:	74 0f                	je     c0108b7e <strfind+0x2c>
            break;
        }
        s ++;
c0108b6f:	ff 45 08             	incl   0x8(%ebp)
    while (*s != '\0') {
c0108b72:	8b 45 08             	mov    0x8(%ebp),%eax
c0108b75:	0f b6 00             	movzbl (%eax),%eax
c0108b78:	84 c0                	test   %al,%al
c0108b7a:	75 e8                	jne    c0108b64 <strfind+0x12>
c0108b7c:	eb 01                	jmp    c0108b7f <strfind+0x2d>
            break;
c0108b7e:	90                   	nop
    }
    return (char *)s;
c0108b7f:	8b 45 08             	mov    0x8(%ebp),%eax
}
c0108b82:	c9                   	leave  
c0108b83:	c3                   	ret    

c0108b84 <strtol>:
 * an optional "0x" or "0X" prefix.
 *
 * The strtol() function returns the converted integral number as a long int value.
 * */
long
strtol(const char *s, char **endptr, int base) {
c0108b84:	f3 0f 1e fb          	endbr32 
c0108b88:	55                   	push   %ebp
c0108b89:	89 e5                	mov    %esp,%ebp
c0108b8b:	83 ec 10             	sub    $0x10,%esp
    int neg = 0;
c0108b8e:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
    long val = 0;
c0108b95:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)

    // gobble initial whitespace
    while (*s == ' ' || *s == '\t') {
c0108b9c:	eb 03                	jmp    c0108ba1 <strtol+0x1d>
        s ++;
c0108b9e:	ff 45 08             	incl   0x8(%ebp)
    while (*s == ' ' || *s == '\t') {
c0108ba1:	8b 45 08             	mov    0x8(%ebp),%eax
c0108ba4:	0f b6 00             	movzbl (%eax),%eax
c0108ba7:	3c 20                	cmp    $0x20,%al
c0108ba9:	74 f3                	je     c0108b9e <strtol+0x1a>
c0108bab:	8b 45 08             	mov    0x8(%ebp),%eax
c0108bae:	0f b6 00             	movzbl (%eax),%eax
c0108bb1:	3c 09                	cmp    $0x9,%al
c0108bb3:	74 e9                	je     c0108b9e <strtol+0x1a>
    }

    // plus/minus sign
    if (*s == '+') {
c0108bb5:	8b 45 08             	mov    0x8(%ebp),%eax
c0108bb8:	0f b6 00             	movzbl (%eax),%eax
c0108bbb:	3c 2b                	cmp    $0x2b,%al
c0108bbd:	75 05                	jne    c0108bc4 <strtol+0x40>
        s ++;
c0108bbf:	ff 45 08             	incl   0x8(%ebp)
c0108bc2:	eb 14                	jmp    c0108bd8 <strtol+0x54>
    }
    else if (*s == '-') {
c0108bc4:	8b 45 08             	mov    0x8(%ebp),%eax
c0108bc7:	0f b6 00             	movzbl (%eax),%eax
c0108bca:	3c 2d                	cmp    $0x2d,%al
c0108bcc:	75 0a                	jne    c0108bd8 <strtol+0x54>
        s ++, neg = 1;
c0108bce:	ff 45 08             	incl   0x8(%ebp)
c0108bd1:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%ebp)
    }

    // hex or octal base prefix
    if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x')) {
c0108bd8:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0108bdc:	74 06                	je     c0108be4 <strtol+0x60>
c0108bde:	83 7d 10 10          	cmpl   $0x10,0x10(%ebp)
c0108be2:	75 22                	jne    c0108c06 <strtol+0x82>
c0108be4:	8b 45 08             	mov    0x8(%ebp),%eax
c0108be7:	0f b6 00             	movzbl (%eax),%eax
c0108bea:	3c 30                	cmp    $0x30,%al
c0108bec:	75 18                	jne    c0108c06 <strtol+0x82>
c0108bee:	8b 45 08             	mov    0x8(%ebp),%eax
c0108bf1:	40                   	inc    %eax
c0108bf2:	0f b6 00             	movzbl (%eax),%eax
c0108bf5:	3c 78                	cmp    $0x78,%al
c0108bf7:	75 0d                	jne    c0108c06 <strtol+0x82>
        s += 2, base = 16;
c0108bf9:	83 45 08 02          	addl   $0x2,0x8(%ebp)
c0108bfd:	c7 45 10 10 00 00 00 	movl   $0x10,0x10(%ebp)
c0108c04:	eb 29                	jmp    c0108c2f <strtol+0xab>
    }
    else if (base == 0 && s[0] == '0') {
c0108c06:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0108c0a:	75 16                	jne    c0108c22 <strtol+0x9e>
c0108c0c:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c0f:	0f b6 00             	movzbl (%eax),%eax
c0108c12:	3c 30                	cmp    $0x30,%al
c0108c14:	75 0c                	jne    c0108c22 <strtol+0x9e>
        s ++, base = 8;
c0108c16:	ff 45 08             	incl   0x8(%ebp)
c0108c19:	c7 45 10 08 00 00 00 	movl   $0x8,0x10(%ebp)
c0108c20:	eb 0d                	jmp    c0108c2f <strtol+0xab>
    }
    else if (base == 0) {
c0108c22:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
c0108c26:	75 07                	jne    c0108c2f <strtol+0xab>
        base = 10;
c0108c28:	c7 45 10 0a 00 00 00 	movl   $0xa,0x10(%ebp)

    // digits
    while (1) {
        int dig;

        if (*s >= '0' && *s <= '9') {
c0108c2f:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c32:	0f b6 00             	movzbl (%eax),%eax
c0108c35:	3c 2f                	cmp    $0x2f,%al
c0108c37:	7e 1b                	jle    c0108c54 <strtol+0xd0>
c0108c39:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c3c:	0f b6 00             	movzbl (%eax),%eax
c0108c3f:	3c 39                	cmp    $0x39,%al
c0108c41:	7f 11                	jg     c0108c54 <strtol+0xd0>
            dig = *s - '0';
c0108c43:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c46:	0f b6 00             	movzbl (%eax),%eax
c0108c49:	0f be c0             	movsbl %al,%eax
c0108c4c:	83 e8 30             	sub    $0x30,%eax
c0108c4f:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0108c52:	eb 48                	jmp    c0108c9c <strtol+0x118>
        }
        else if (*s >= 'a' && *s <= 'z') {
c0108c54:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c57:	0f b6 00             	movzbl (%eax),%eax
c0108c5a:	3c 60                	cmp    $0x60,%al
c0108c5c:	7e 1b                	jle    c0108c79 <strtol+0xf5>
c0108c5e:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c61:	0f b6 00             	movzbl (%eax),%eax
c0108c64:	3c 7a                	cmp    $0x7a,%al
c0108c66:	7f 11                	jg     c0108c79 <strtol+0xf5>
            dig = *s - 'a' + 10;
c0108c68:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c6b:	0f b6 00             	movzbl (%eax),%eax
c0108c6e:	0f be c0             	movsbl %al,%eax
c0108c71:	83 e8 57             	sub    $0x57,%eax
c0108c74:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0108c77:	eb 23                	jmp    c0108c9c <strtol+0x118>
        }
        else if (*s >= 'A' && *s <= 'Z') {
c0108c79:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c7c:	0f b6 00             	movzbl (%eax),%eax
c0108c7f:	3c 40                	cmp    $0x40,%al
c0108c81:	7e 3b                	jle    c0108cbe <strtol+0x13a>
c0108c83:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c86:	0f b6 00             	movzbl (%eax),%eax
c0108c89:	3c 5a                	cmp    $0x5a,%al
c0108c8b:	7f 31                	jg     c0108cbe <strtol+0x13a>
            dig = *s - 'A' + 10;
c0108c8d:	8b 45 08             	mov    0x8(%ebp),%eax
c0108c90:	0f b6 00             	movzbl (%eax),%eax
c0108c93:	0f be c0             	movsbl %al,%eax
c0108c96:	83 e8 37             	sub    $0x37,%eax
c0108c99:	89 45 f4             	mov    %eax,-0xc(%ebp)
        }
        else {
            break;
        }
        if (dig >= base) {
c0108c9c:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108c9f:	3b 45 10             	cmp    0x10(%ebp),%eax
c0108ca2:	7d 19                	jge    c0108cbd <strtol+0x139>
            break;
        }
        s ++, val = (val * base) + dig;
c0108ca4:	ff 45 08             	incl   0x8(%ebp)
c0108ca7:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0108caa:	0f af 45 10          	imul   0x10(%ebp),%eax
c0108cae:	89 c2                	mov    %eax,%edx
c0108cb0:	8b 45 f4             	mov    -0xc(%ebp),%eax
c0108cb3:	01 d0                	add    %edx,%eax
c0108cb5:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (1) {
c0108cb8:	e9 72 ff ff ff       	jmp    c0108c2f <strtol+0xab>
            break;
c0108cbd:	90                   	nop
        // we don't properly detect overflow!
    }

    if (endptr) {
c0108cbe:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0108cc2:	74 08                	je     c0108ccc <strtol+0x148>
        *endptr = (char *) s;
c0108cc4:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108cc7:	8b 55 08             	mov    0x8(%ebp),%edx
c0108cca:	89 10                	mov    %edx,(%eax)
    }
    return (neg ? -val : val);
c0108ccc:	83 7d fc 00          	cmpl   $0x0,-0x4(%ebp)
c0108cd0:	74 07                	je     c0108cd9 <strtol+0x155>
c0108cd2:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0108cd5:	f7 d8                	neg    %eax
c0108cd7:	eb 03                	jmp    c0108cdc <strtol+0x158>
c0108cd9:	8b 45 f8             	mov    -0x8(%ebp),%eax
}
c0108cdc:	c9                   	leave  
c0108cdd:	c3                   	ret    

c0108cde <memset>:
 * @n:      number of bytes to be set to the value
 *
 * The memset() function returns @s.
 * */
void *
memset(void *s, char c, size_t n) {
c0108cde:	f3 0f 1e fb          	endbr32 
c0108ce2:	55                   	push   %ebp
c0108ce3:	89 e5                	mov    %esp,%ebp
c0108ce5:	57                   	push   %edi
c0108ce6:	83 ec 24             	sub    $0x24,%esp
c0108ce9:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108cec:	88 45 d8             	mov    %al,-0x28(%ebp)
#ifdef __HAVE_ARCH_MEMSET
    return __memset(s, c, n);
c0108cef:	0f be 55 d8          	movsbl -0x28(%ebp),%edx
c0108cf3:	8b 45 08             	mov    0x8(%ebp),%eax
c0108cf6:	89 45 f8             	mov    %eax,-0x8(%ebp)
c0108cf9:	88 55 f7             	mov    %dl,-0x9(%ebp)
c0108cfc:	8b 45 10             	mov    0x10(%ebp),%eax
c0108cff:	89 45 f0             	mov    %eax,-0x10(%ebp)
#ifndef __HAVE_ARCH_MEMSET
#define __HAVE_ARCH_MEMSET
static inline void *
__memset(void *s, char c, size_t n) {
    int d0, d1;
    asm volatile (
c0108d02:	8b 4d f0             	mov    -0x10(%ebp),%ecx
c0108d05:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
c0108d09:	8b 55 f8             	mov    -0x8(%ebp),%edx
c0108d0c:	89 d7                	mov    %edx,%edi
c0108d0e:	f3 aa                	rep stos %al,%es:(%edi)
c0108d10:	89 fa                	mov    %edi,%edx
c0108d12:	89 4d ec             	mov    %ecx,-0x14(%ebp)
c0108d15:	89 55 e8             	mov    %edx,-0x18(%ebp)
        "rep; stosb;"
        : "=&c" (d0), "=&D" (d1)
        : "0" (n), "a" (c), "1" (s)
        : "memory");
    return s;
c0108d18:	8b 45 f8             	mov    -0x8(%ebp),%eax
    while (n -- > 0) {
        *p ++ = c;
    }
    return s;
#endif /* __HAVE_ARCH_MEMSET */
}
c0108d1b:	83 c4 24             	add    $0x24,%esp
c0108d1e:	5f                   	pop    %edi
c0108d1f:	5d                   	pop    %ebp
c0108d20:	c3                   	ret    

c0108d21 <memmove>:
 * @n:      number of bytes to copy
 *
 * The memmove() function returns @dst.
 * */
void *
memmove(void *dst, const void *src, size_t n) {
c0108d21:	f3 0f 1e fb          	endbr32 
c0108d25:	55                   	push   %ebp
c0108d26:	89 e5                	mov    %esp,%ebp
c0108d28:	57                   	push   %edi
c0108d29:	56                   	push   %esi
c0108d2a:	53                   	push   %ebx
c0108d2b:	83 ec 30             	sub    $0x30,%esp
c0108d2e:	8b 45 08             	mov    0x8(%ebp),%eax
c0108d31:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108d34:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108d37:	89 45 ec             	mov    %eax,-0x14(%ebp)
c0108d3a:	8b 45 10             	mov    0x10(%ebp),%eax
c0108d3d:	89 45 e8             	mov    %eax,-0x18(%ebp)

#ifndef __HAVE_ARCH_MEMMOVE
#define __HAVE_ARCH_MEMMOVE
static inline void *
__memmove(void *dst, const void *src, size_t n) {
    if (dst < src) {
c0108d40:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108d43:	3b 45 ec             	cmp    -0x14(%ebp),%eax
c0108d46:	73 42                	jae    c0108d8a <memmove+0x69>
c0108d48:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108d4b:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0108d4e:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0108d51:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0108d54:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108d57:	89 45 dc             	mov    %eax,-0x24(%ebp)
        "andl $3, %%ecx;"
        "jz 1f;"
        "rep; movsb;"
        "1:"
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0108d5a:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0108d5d:	c1 e8 02             	shr    $0x2,%eax
c0108d60:	89 c1                	mov    %eax,%ecx
    asm volatile (
c0108d62:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c0108d65:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0108d68:	89 d7                	mov    %edx,%edi
c0108d6a:	89 c6                	mov    %eax,%esi
c0108d6c:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0108d6e:	8b 4d dc             	mov    -0x24(%ebp),%ecx
c0108d71:	83 e1 03             	and    $0x3,%ecx
c0108d74:	74 02                	je     c0108d78 <memmove+0x57>
c0108d76:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0108d78:	89 f0                	mov    %esi,%eax
c0108d7a:	89 fa                	mov    %edi,%edx
c0108d7c:	89 4d d8             	mov    %ecx,-0x28(%ebp)
c0108d7f:	89 55 d4             	mov    %edx,-0x2c(%ebp)
c0108d82:	89 45 d0             	mov    %eax,-0x30(%ebp)
        : "memory");
    return dst;
c0108d85:	8b 45 e4             	mov    -0x1c(%ebp),%eax
        return __memcpy(dst, src, n);
c0108d88:	eb 36                	jmp    c0108dc0 <memmove+0x9f>
        : "0" (n), "1" (n - 1 + src), "2" (n - 1 + dst)
c0108d8a:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108d8d:	8d 50 ff             	lea    -0x1(%eax),%edx
c0108d90:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0108d93:	01 c2                	add    %eax,%edx
c0108d95:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108d98:	8d 48 ff             	lea    -0x1(%eax),%ecx
c0108d9b:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108d9e:	8d 1c 01             	lea    (%ecx,%eax,1),%ebx
    asm volatile (
c0108da1:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108da4:	89 c1                	mov    %eax,%ecx
c0108da6:	89 d8                	mov    %ebx,%eax
c0108da8:	89 d6                	mov    %edx,%esi
c0108daa:	89 c7                	mov    %eax,%edi
c0108dac:	fd                   	std    
c0108dad:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0108daf:	fc                   	cld    
c0108db0:	89 f8                	mov    %edi,%eax
c0108db2:	89 f2                	mov    %esi,%edx
c0108db4:	89 4d cc             	mov    %ecx,-0x34(%ebp)
c0108db7:	89 55 c8             	mov    %edx,-0x38(%ebp)
c0108dba:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    return dst;
c0108dbd:	8b 45 f0             	mov    -0x10(%ebp),%eax
            *d ++ = *s ++;
        }
    }
    return dst;
#endif /* __HAVE_ARCH_MEMMOVE */
}
c0108dc0:	83 c4 30             	add    $0x30,%esp
c0108dc3:	5b                   	pop    %ebx
c0108dc4:	5e                   	pop    %esi
c0108dc5:	5f                   	pop    %edi
c0108dc6:	5d                   	pop    %ebp
c0108dc7:	c3                   	ret    

c0108dc8 <memcpy>:
 * it always copies exactly @n bytes. To avoid overflows, the size of arrays pointed
 * by both @src and @dst, should be at least @n bytes, and should not overlap
 * (for overlapping memory area, memmove is a safer approach).
 * */
void *
memcpy(void *dst, const void *src, size_t n) {
c0108dc8:	f3 0f 1e fb          	endbr32 
c0108dcc:	55                   	push   %ebp
c0108dcd:	89 e5                	mov    %esp,%ebp
c0108dcf:	57                   	push   %edi
c0108dd0:	56                   	push   %esi
c0108dd1:	83 ec 20             	sub    $0x20,%esp
c0108dd4:	8b 45 08             	mov    0x8(%ebp),%eax
c0108dd7:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0108dda:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108ddd:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108de0:	8b 45 10             	mov    0x10(%ebp),%eax
c0108de3:	89 45 ec             	mov    %eax,-0x14(%ebp)
        : "0" (n / 4), "g" (n), "1" (dst), "2" (src)
c0108de6:	8b 45 ec             	mov    -0x14(%ebp),%eax
c0108de9:	c1 e8 02             	shr    $0x2,%eax
c0108dec:	89 c1                	mov    %eax,%ecx
    asm volatile (
c0108dee:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0108df1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108df4:	89 d7                	mov    %edx,%edi
c0108df6:	89 c6                	mov    %eax,%esi
c0108df8:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
c0108dfa:	8b 4d ec             	mov    -0x14(%ebp),%ecx
c0108dfd:	83 e1 03             	and    $0x3,%ecx
c0108e00:	74 02                	je     c0108e04 <memcpy+0x3c>
c0108e02:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
c0108e04:	89 f0                	mov    %esi,%eax
c0108e06:	89 fa                	mov    %edi,%edx
c0108e08:	89 4d e8             	mov    %ecx,-0x18(%ebp)
c0108e0b:	89 55 e4             	mov    %edx,-0x1c(%ebp)
c0108e0e:	89 45 e0             	mov    %eax,-0x20(%ebp)
    return dst;
c0108e11:	8b 45 f4             	mov    -0xc(%ebp),%eax
    while (n -- > 0) {
        *d ++ = *s ++;
    }
    return dst;
#endif /* __HAVE_ARCH_MEMCPY */
}
c0108e14:	83 c4 20             	add    $0x20,%esp
c0108e17:	5e                   	pop    %esi
c0108e18:	5f                   	pop    %edi
c0108e19:	5d                   	pop    %ebp
c0108e1a:	c3                   	ret    

c0108e1b <memcmp>:
 *   match in both memory blocks has a greater value in @v1 than in @v2
 *   as if evaluated as unsigned char values;
 * - And a value less than zero indicates the opposite.
 * */
int
memcmp(const void *v1, const void *v2, size_t n) {
c0108e1b:	f3 0f 1e fb          	endbr32 
c0108e1f:	55                   	push   %ebp
c0108e20:	89 e5                	mov    %esp,%ebp
c0108e22:	83 ec 10             	sub    $0x10,%esp
    const char *s1 = (const char *)v1;
c0108e25:	8b 45 08             	mov    0x8(%ebp),%eax
c0108e28:	89 45 fc             	mov    %eax,-0x4(%ebp)
    const char *s2 = (const char *)v2;
c0108e2b:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108e2e:	89 45 f8             	mov    %eax,-0x8(%ebp)
    while (n -- > 0) {
c0108e31:	eb 2e                	jmp    c0108e61 <memcmp+0x46>
        if (*s1 != *s2) {
c0108e33:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0108e36:	0f b6 10             	movzbl (%eax),%edx
c0108e39:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0108e3c:	0f b6 00             	movzbl (%eax),%eax
c0108e3f:	38 c2                	cmp    %al,%dl
c0108e41:	74 18                	je     c0108e5b <memcmp+0x40>
            return (int)((unsigned char)*s1 - (unsigned char)*s2);
c0108e43:	8b 45 fc             	mov    -0x4(%ebp),%eax
c0108e46:	0f b6 00             	movzbl (%eax),%eax
c0108e49:	0f b6 d0             	movzbl %al,%edx
c0108e4c:	8b 45 f8             	mov    -0x8(%ebp),%eax
c0108e4f:	0f b6 00             	movzbl (%eax),%eax
c0108e52:	0f b6 c0             	movzbl %al,%eax
c0108e55:	29 c2                	sub    %eax,%edx
c0108e57:	89 d0                	mov    %edx,%eax
c0108e59:	eb 18                	jmp    c0108e73 <memcmp+0x58>
        }
        s1 ++, s2 ++;
c0108e5b:	ff 45 fc             	incl   -0x4(%ebp)
c0108e5e:	ff 45 f8             	incl   -0x8(%ebp)
    while (n -- > 0) {
c0108e61:	8b 45 10             	mov    0x10(%ebp),%eax
c0108e64:	8d 50 ff             	lea    -0x1(%eax),%edx
c0108e67:	89 55 10             	mov    %edx,0x10(%ebp)
c0108e6a:	85 c0                	test   %eax,%eax
c0108e6c:	75 c5                	jne    c0108e33 <memcmp+0x18>
    }
    return 0;
c0108e6e:	b8 00 00 00 00       	mov    $0x0,%eax
}
c0108e73:	c9                   	leave  
c0108e74:	c3                   	ret    

c0108e75 <printnum>:
 * @width:      maximum number of digits, if the actual width is less than @width, use @padc instead
 * @padc:       character that padded on the left if the actual width is less than @width
 * */
static void
printnum(void (*putch)(int, void*), void *putdat,
        unsigned long long num, unsigned base, int width, int padc) {
c0108e75:	f3 0f 1e fb          	endbr32 
c0108e79:	55                   	push   %ebp
c0108e7a:	89 e5                	mov    %esp,%ebp
c0108e7c:	83 ec 58             	sub    $0x58,%esp
c0108e7f:	8b 45 10             	mov    0x10(%ebp),%eax
c0108e82:	89 45 d0             	mov    %eax,-0x30(%ebp)
c0108e85:	8b 45 14             	mov    0x14(%ebp),%eax
c0108e88:	89 45 d4             	mov    %eax,-0x2c(%ebp)
    unsigned long long result = num;
c0108e8b:	8b 45 d0             	mov    -0x30(%ebp),%eax
c0108e8e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
c0108e91:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0108e94:	89 55 ec             	mov    %edx,-0x14(%ebp)
    unsigned mod = do_div(result, base);
c0108e97:	8b 45 18             	mov    0x18(%ebp),%eax
c0108e9a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
c0108e9d:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108ea0:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0108ea3:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0108ea6:	89 55 f0             	mov    %edx,-0x10(%ebp)
c0108ea9:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108eac:	89 45 f4             	mov    %eax,-0xc(%ebp)
c0108eaf:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
c0108eb3:	74 1c                	je     c0108ed1 <printnum+0x5c>
c0108eb5:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108eb8:	ba 00 00 00 00       	mov    $0x0,%edx
c0108ebd:	f7 75 e4             	divl   -0x1c(%ebp)
c0108ec0:	89 55 f4             	mov    %edx,-0xc(%ebp)
c0108ec3:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0108ec6:	ba 00 00 00 00       	mov    $0x0,%edx
c0108ecb:	f7 75 e4             	divl   -0x1c(%ebp)
c0108ece:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0108ed1:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0108ed4:	8b 55 f4             	mov    -0xc(%ebp),%edx
c0108ed7:	f7 75 e4             	divl   -0x1c(%ebp)
c0108eda:	89 45 e0             	mov    %eax,-0x20(%ebp)
c0108edd:	89 55 dc             	mov    %edx,-0x24(%ebp)
c0108ee0:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0108ee3:	8b 55 f0             	mov    -0x10(%ebp),%edx
c0108ee6:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0108ee9:	89 55 ec             	mov    %edx,-0x14(%ebp)
c0108eec:	8b 45 dc             	mov    -0x24(%ebp),%eax
c0108eef:	89 45 d8             	mov    %eax,-0x28(%ebp)

    // first recursively print all preceding (more significant) digits
    if (num >= base) {
c0108ef2:	8b 45 18             	mov    0x18(%ebp),%eax
c0108ef5:	ba 00 00 00 00       	mov    $0x0,%edx
c0108efa:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
c0108efd:	39 45 d0             	cmp    %eax,-0x30(%ebp)
c0108f00:	19 d1                	sbb    %edx,%ecx
c0108f02:	72 4c                	jb     c0108f50 <printnum+0xdb>
        printnum(putch, putdat, result, base, width - 1, padc);
c0108f04:	8b 45 1c             	mov    0x1c(%ebp),%eax
c0108f07:	8d 50 ff             	lea    -0x1(%eax),%edx
c0108f0a:	8b 45 20             	mov    0x20(%ebp),%eax
c0108f0d:	89 44 24 18          	mov    %eax,0x18(%esp)
c0108f11:	89 54 24 14          	mov    %edx,0x14(%esp)
c0108f15:	8b 45 18             	mov    0x18(%ebp),%eax
c0108f18:	89 44 24 10          	mov    %eax,0x10(%esp)
c0108f1c:	8b 45 e8             	mov    -0x18(%ebp),%eax
c0108f1f:	8b 55 ec             	mov    -0x14(%ebp),%edx
c0108f22:	89 44 24 08          	mov    %eax,0x8(%esp)
c0108f26:	89 54 24 0c          	mov    %edx,0xc(%esp)
c0108f2a:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108f2d:	89 44 24 04          	mov    %eax,0x4(%esp)
c0108f31:	8b 45 08             	mov    0x8(%ebp),%eax
c0108f34:	89 04 24             	mov    %eax,(%esp)
c0108f37:	e8 39 ff ff ff       	call   c0108e75 <printnum>
c0108f3c:	eb 1b                	jmp    c0108f59 <printnum+0xe4>
    } else {
        // print any needed pad characters before first digit
        while (-- width > 0)
            putch(padc, putdat);
c0108f3e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0108f41:	89 44 24 04          	mov    %eax,0x4(%esp)
c0108f45:	8b 45 20             	mov    0x20(%ebp),%eax
c0108f48:	89 04 24             	mov    %eax,(%esp)
c0108f4b:	8b 45 08             	mov    0x8(%ebp),%eax
c0108f4e:	ff d0                	call   *%eax
        while (-- width > 0)
c0108f50:	ff 4d 1c             	decl   0x1c(%ebp)
c0108f53:	83 7d 1c 00          	cmpl   $0x0,0x1c(%ebp)
c0108f57:	7f e5                	jg     c0108f3e <printnum+0xc9>
    }
    // then print this (the least significant) digit
    putch("0123456789abcdef"[mod], putdat);
c0108f59:	8b 45 d8             	mov    -0x28(%ebp),%eax
c0108f5c:	05 3c b0 10 c0       	add    $0xc010b03c,%eax
c0108f61:	0f b6 00             	movzbl (%eax),%eax
c0108f64:	0f be c0             	movsbl %al,%eax
c0108f67:	8b 55 0c             	mov    0xc(%ebp),%edx
c0108f6a:	89 54 24 04          	mov    %edx,0x4(%esp)
c0108f6e:	89 04 24             	mov    %eax,(%esp)
c0108f71:	8b 45 08             	mov    0x8(%ebp),%eax
c0108f74:	ff d0                	call   *%eax
}
c0108f76:	90                   	nop
c0108f77:	c9                   	leave  
c0108f78:	c3                   	ret    

c0108f79 <getuint>:
 * getuint - get an unsigned int of various possible sizes from a varargs list
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static unsigned long long
getuint(va_list *ap, int lflag) {
c0108f79:	f3 0f 1e fb          	endbr32 
c0108f7d:	55                   	push   %ebp
c0108f7e:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c0108f80:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0108f84:	7e 14                	jle    c0108f9a <getuint+0x21>
        return va_arg(*ap, unsigned long long);
c0108f86:	8b 45 08             	mov    0x8(%ebp),%eax
c0108f89:	8b 00                	mov    (%eax),%eax
c0108f8b:	8d 48 08             	lea    0x8(%eax),%ecx
c0108f8e:	8b 55 08             	mov    0x8(%ebp),%edx
c0108f91:	89 0a                	mov    %ecx,(%edx)
c0108f93:	8b 50 04             	mov    0x4(%eax),%edx
c0108f96:	8b 00                	mov    (%eax),%eax
c0108f98:	eb 30                	jmp    c0108fca <getuint+0x51>
    }
    else if (lflag) {
c0108f9a:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0108f9e:	74 16                	je     c0108fb6 <getuint+0x3d>
        return va_arg(*ap, unsigned long);
c0108fa0:	8b 45 08             	mov    0x8(%ebp),%eax
c0108fa3:	8b 00                	mov    (%eax),%eax
c0108fa5:	8d 48 04             	lea    0x4(%eax),%ecx
c0108fa8:	8b 55 08             	mov    0x8(%ebp),%edx
c0108fab:	89 0a                	mov    %ecx,(%edx)
c0108fad:	8b 00                	mov    (%eax),%eax
c0108faf:	ba 00 00 00 00       	mov    $0x0,%edx
c0108fb4:	eb 14                	jmp    c0108fca <getuint+0x51>
    }
    else {
        return va_arg(*ap, unsigned int);
c0108fb6:	8b 45 08             	mov    0x8(%ebp),%eax
c0108fb9:	8b 00                	mov    (%eax),%eax
c0108fbb:	8d 48 04             	lea    0x4(%eax),%ecx
c0108fbe:	8b 55 08             	mov    0x8(%ebp),%edx
c0108fc1:	89 0a                	mov    %ecx,(%edx)
c0108fc3:	8b 00                	mov    (%eax),%eax
c0108fc5:	ba 00 00 00 00       	mov    $0x0,%edx
    }
}
c0108fca:	5d                   	pop    %ebp
c0108fcb:	c3                   	ret    

c0108fcc <getint>:
 * getint - same as getuint but signed, we can't use getuint because of sign extension
 * @ap:         a varargs list pointer
 * @lflag:      determines the size of the vararg that @ap points to
 * */
static long long
getint(va_list *ap, int lflag) {
c0108fcc:	f3 0f 1e fb          	endbr32 
c0108fd0:	55                   	push   %ebp
c0108fd1:	89 e5                	mov    %esp,%ebp
    if (lflag >= 2) {
c0108fd3:	83 7d 0c 01          	cmpl   $0x1,0xc(%ebp)
c0108fd7:	7e 14                	jle    c0108fed <getint+0x21>
        return va_arg(*ap, long long);
c0108fd9:	8b 45 08             	mov    0x8(%ebp),%eax
c0108fdc:	8b 00                	mov    (%eax),%eax
c0108fde:	8d 48 08             	lea    0x8(%eax),%ecx
c0108fe1:	8b 55 08             	mov    0x8(%ebp),%edx
c0108fe4:	89 0a                	mov    %ecx,(%edx)
c0108fe6:	8b 50 04             	mov    0x4(%eax),%edx
c0108fe9:	8b 00                	mov    (%eax),%eax
c0108feb:	eb 28                	jmp    c0109015 <getint+0x49>
    }
    else if (lflag) {
c0108fed:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
c0108ff1:	74 12                	je     c0109005 <getint+0x39>
        return va_arg(*ap, long);
c0108ff3:	8b 45 08             	mov    0x8(%ebp),%eax
c0108ff6:	8b 00                	mov    (%eax),%eax
c0108ff8:	8d 48 04             	lea    0x4(%eax),%ecx
c0108ffb:	8b 55 08             	mov    0x8(%ebp),%edx
c0108ffe:	89 0a                	mov    %ecx,(%edx)
c0109000:	8b 00                	mov    (%eax),%eax
c0109002:	99                   	cltd   
c0109003:	eb 10                	jmp    c0109015 <getint+0x49>
    }
    else {
        return va_arg(*ap, int);
c0109005:	8b 45 08             	mov    0x8(%ebp),%eax
c0109008:	8b 00                	mov    (%eax),%eax
c010900a:	8d 48 04             	lea    0x4(%eax),%ecx
c010900d:	8b 55 08             	mov    0x8(%ebp),%edx
c0109010:	89 0a                	mov    %ecx,(%edx)
c0109012:	8b 00                	mov    (%eax),%eax
c0109014:	99                   	cltd   
    }
}
c0109015:	5d                   	pop    %ebp
c0109016:	c3                   	ret    

c0109017 <printfmt>:
 * @putch:      specified putch function, print a single character
 * @putdat:     used by @putch function
 * @fmt:        the format string to use
 * */
void
printfmt(void (*putch)(int, void*), void *putdat, const char *fmt, ...) {
c0109017:	f3 0f 1e fb          	endbr32 
c010901b:	55                   	push   %ebp
c010901c:	89 e5                	mov    %esp,%ebp
c010901e:	83 ec 28             	sub    $0x28,%esp
    va_list ap;

    va_start(ap, fmt);
c0109021:	8d 45 14             	lea    0x14(%ebp),%eax
c0109024:	89 45 f4             	mov    %eax,-0xc(%ebp)
    vprintfmt(putch, putdat, fmt, ap);
c0109027:	8b 45 f4             	mov    -0xc(%ebp),%eax
c010902a:	89 44 24 0c          	mov    %eax,0xc(%esp)
c010902e:	8b 45 10             	mov    0x10(%ebp),%eax
c0109031:	89 44 24 08          	mov    %eax,0x8(%esp)
c0109035:	8b 45 0c             	mov    0xc(%ebp),%eax
c0109038:	89 44 24 04          	mov    %eax,0x4(%esp)
c010903c:	8b 45 08             	mov    0x8(%ebp),%eax
c010903f:	89 04 24             	mov    %eax,(%esp)
c0109042:	e8 03 00 00 00       	call   c010904a <vprintfmt>
    va_end(ap);
}
c0109047:	90                   	nop
c0109048:	c9                   	leave  
c0109049:	c3                   	ret    

c010904a <vprintfmt>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want printfmt() instead.
 * */
void
vprintfmt(void (*putch)(int, void*), void *putdat, const char *fmt, va_list ap) {
c010904a:	f3 0f 1e fb          	endbr32 
c010904e:	55                   	push   %ebp
c010904f:	89 e5                	mov    %esp,%ebp
c0109051:	56                   	push   %esi
c0109052:	53                   	push   %ebx
c0109053:	83 ec 40             	sub    $0x40,%esp
    register int ch, err;
    unsigned long long num;
    int base, width, precision, lflag, altflag;

    while (1) {
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c0109056:	eb 17                	jmp    c010906f <vprintfmt+0x25>
            if (ch == '\0') {
c0109058:	85 db                	test   %ebx,%ebx
c010905a:	0f 84 c0 03 00 00    	je     c0109420 <vprintfmt+0x3d6>
                return;
            }
            putch(ch, putdat);
c0109060:	8b 45 0c             	mov    0xc(%ebp),%eax
c0109063:	89 44 24 04          	mov    %eax,0x4(%esp)
c0109067:	89 1c 24             	mov    %ebx,(%esp)
c010906a:	8b 45 08             	mov    0x8(%ebp),%eax
c010906d:	ff d0                	call   *%eax
        while ((ch = *(unsigned char *)fmt ++) != '%') {
c010906f:	8b 45 10             	mov    0x10(%ebp),%eax
c0109072:	8d 50 01             	lea    0x1(%eax),%edx
c0109075:	89 55 10             	mov    %edx,0x10(%ebp)
c0109078:	0f b6 00             	movzbl (%eax),%eax
c010907b:	0f b6 d8             	movzbl %al,%ebx
c010907e:	83 fb 25             	cmp    $0x25,%ebx
c0109081:	75 d5                	jne    c0109058 <vprintfmt+0xe>
        }

        // Process a %-escape sequence
        char padc = ' ';
c0109083:	c6 45 db 20          	movb   $0x20,-0x25(%ebp)
        width = precision = -1;
c0109087:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
c010908e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0109091:	89 45 e8             	mov    %eax,-0x18(%ebp)
        lflag = altflag = 0;
c0109094:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
c010909b:	8b 45 dc             	mov    -0x24(%ebp),%eax
c010909e:	89 45 e0             	mov    %eax,-0x20(%ebp)

    reswitch:
        switch (ch = *(unsigned char *)fmt ++) {
c01090a1:	8b 45 10             	mov    0x10(%ebp),%eax
c01090a4:	8d 50 01             	lea    0x1(%eax),%edx
c01090a7:	89 55 10             	mov    %edx,0x10(%ebp)
c01090aa:	0f b6 00             	movzbl (%eax),%eax
c01090ad:	0f b6 d8             	movzbl %al,%ebx
c01090b0:	8d 43 dd             	lea    -0x23(%ebx),%eax
c01090b3:	83 f8 55             	cmp    $0x55,%eax
c01090b6:	0f 87 38 03 00 00    	ja     c01093f4 <vprintfmt+0x3aa>
c01090bc:	8b 04 85 60 b0 10 c0 	mov    -0x3fef4fa0(,%eax,4),%eax
c01090c3:	3e ff e0             	notrack jmp *%eax

        // flag to pad on the right
        case '-':
            padc = '-';
c01090c6:	c6 45 db 2d          	movb   $0x2d,-0x25(%ebp)
            goto reswitch;
c01090ca:	eb d5                	jmp    c01090a1 <vprintfmt+0x57>

        // flag to pad with 0's instead of spaces
        case '0':
            padc = '0';
c01090cc:	c6 45 db 30          	movb   $0x30,-0x25(%ebp)
            goto reswitch;
c01090d0:	eb cf                	jmp    c01090a1 <vprintfmt+0x57>

        // width field
        case '1' ... '9':
            for (precision = 0; ; ++ fmt) {
c01090d2:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
                precision = precision * 10 + ch - '0';
c01090d9:	8b 55 e4             	mov    -0x1c(%ebp),%edx
c01090dc:	89 d0                	mov    %edx,%eax
c01090de:	c1 e0 02             	shl    $0x2,%eax
c01090e1:	01 d0                	add    %edx,%eax
c01090e3:	01 c0                	add    %eax,%eax
c01090e5:	01 d8                	add    %ebx,%eax
c01090e7:	83 e8 30             	sub    $0x30,%eax
c01090ea:	89 45 e4             	mov    %eax,-0x1c(%ebp)
                ch = *fmt;
c01090ed:	8b 45 10             	mov    0x10(%ebp),%eax
c01090f0:	0f b6 00             	movzbl (%eax),%eax
c01090f3:	0f be d8             	movsbl %al,%ebx
                if (ch < '0' || ch > '9') {
c01090f6:	83 fb 2f             	cmp    $0x2f,%ebx
c01090f9:	7e 38                	jle    c0109133 <vprintfmt+0xe9>
c01090fb:	83 fb 39             	cmp    $0x39,%ebx
c01090fe:	7f 33                	jg     c0109133 <vprintfmt+0xe9>
            for (precision = 0; ; ++ fmt) {
c0109100:	ff 45 10             	incl   0x10(%ebp)
                precision = precision * 10 + ch - '0';
c0109103:	eb d4                	jmp    c01090d9 <vprintfmt+0x8f>
                }
            }
            goto process_precision;

        case '*':
            precision = va_arg(ap, int);
c0109105:	8b 45 14             	mov    0x14(%ebp),%eax
c0109108:	8d 50 04             	lea    0x4(%eax),%edx
c010910b:	89 55 14             	mov    %edx,0x14(%ebp)
c010910e:	8b 00                	mov    (%eax),%eax
c0109110:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            goto process_precision;
c0109113:	eb 1f                	jmp    c0109134 <vprintfmt+0xea>

        case '.':
            if (width < 0)
c0109115:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0109119:	79 86                	jns    c01090a1 <vprintfmt+0x57>
                width = 0;
c010911b:	c7 45 e8 00 00 00 00 	movl   $0x0,-0x18(%ebp)
            goto reswitch;
c0109122:	e9 7a ff ff ff       	jmp    c01090a1 <vprintfmt+0x57>

        case '#':
            altflag = 1;
c0109127:	c7 45 dc 01 00 00 00 	movl   $0x1,-0x24(%ebp)
            goto reswitch;
c010912e:	e9 6e ff ff ff       	jmp    c01090a1 <vprintfmt+0x57>
            goto process_precision;
c0109133:	90                   	nop

        process_precision:
            if (width < 0)
c0109134:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0109138:	0f 89 63 ff ff ff    	jns    c01090a1 <vprintfmt+0x57>
                width = precision, precision = -1;
c010913e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0109141:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0109144:	c7 45 e4 ff ff ff ff 	movl   $0xffffffff,-0x1c(%ebp)
            goto reswitch;
c010914b:	e9 51 ff ff ff       	jmp    c01090a1 <vprintfmt+0x57>

        // long flag (doubled for long long)
        case 'l':
            lflag ++;
c0109150:	ff 45 e0             	incl   -0x20(%ebp)
            goto reswitch;
c0109153:	e9 49 ff ff ff       	jmp    c01090a1 <vprintfmt+0x57>

        // character
        case 'c':
            putch(va_arg(ap, int), putdat);
c0109158:	8b 45 14             	mov    0x14(%ebp),%eax
c010915b:	8d 50 04             	lea    0x4(%eax),%edx
c010915e:	89 55 14             	mov    %edx,0x14(%ebp)
c0109161:	8b 00                	mov    (%eax),%eax
c0109163:	8b 55 0c             	mov    0xc(%ebp),%edx
c0109166:	89 54 24 04          	mov    %edx,0x4(%esp)
c010916a:	89 04 24             	mov    %eax,(%esp)
c010916d:	8b 45 08             	mov    0x8(%ebp),%eax
c0109170:	ff d0                	call   *%eax
            break;
c0109172:	e9 a4 02 00 00       	jmp    c010941b <vprintfmt+0x3d1>

        // error message
        case 'e':
            err = va_arg(ap, int);
c0109177:	8b 45 14             	mov    0x14(%ebp),%eax
c010917a:	8d 50 04             	lea    0x4(%eax),%edx
c010917d:	89 55 14             	mov    %edx,0x14(%ebp)
c0109180:	8b 18                	mov    (%eax),%ebx
            if (err < 0) {
c0109182:	85 db                	test   %ebx,%ebx
c0109184:	79 02                	jns    c0109188 <vprintfmt+0x13e>
                err = -err;
c0109186:	f7 db                	neg    %ebx
            }
            if (err > MAXERROR || (p = error_string[err]) == NULL) {
c0109188:	83 fb 06             	cmp    $0x6,%ebx
c010918b:	7f 0b                	jg     c0109198 <vprintfmt+0x14e>
c010918d:	8b 34 9d 20 b0 10 c0 	mov    -0x3fef4fe0(,%ebx,4),%esi
c0109194:	85 f6                	test   %esi,%esi
c0109196:	75 23                	jne    c01091bb <vprintfmt+0x171>
                printfmt(putch, putdat, "error %d", err);
c0109198:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
c010919c:	c7 44 24 08 4d b0 10 	movl   $0xc010b04d,0x8(%esp)
c01091a3:	c0 
c01091a4:	8b 45 0c             	mov    0xc(%ebp),%eax
c01091a7:	89 44 24 04          	mov    %eax,0x4(%esp)
c01091ab:	8b 45 08             	mov    0x8(%ebp),%eax
c01091ae:	89 04 24             	mov    %eax,(%esp)
c01091b1:	e8 61 fe ff ff       	call   c0109017 <printfmt>
            }
            else {
                printfmt(putch, putdat, "%s", p);
            }
            break;
c01091b6:	e9 60 02 00 00       	jmp    c010941b <vprintfmt+0x3d1>
                printfmt(putch, putdat, "%s", p);
c01091bb:	89 74 24 0c          	mov    %esi,0xc(%esp)
c01091bf:	c7 44 24 08 56 b0 10 	movl   $0xc010b056,0x8(%esp)
c01091c6:	c0 
c01091c7:	8b 45 0c             	mov    0xc(%ebp),%eax
c01091ca:	89 44 24 04          	mov    %eax,0x4(%esp)
c01091ce:	8b 45 08             	mov    0x8(%ebp),%eax
c01091d1:	89 04 24             	mov    %eax,(%esp)
c01091d4:	e8 3e fe ff ff       	call   c0109017 <printfmt>
            break;
c01091d9:	e9 3d 02 00 00       	jmp    c010941b <vprintfmt+0x3d1>

        // string
        case 's':
            if ((p = va_arg(ap, char *)) == NULL) {
c01091de:	8b 45 14             	mov    0x14(%ebp),%eax
c01091e1:	8d 50 04             	lea    0x4(%eax),%edx
c01091e4:	89 55 14             	mov    %edx,0x14(%ebp)
c01091e7:	8b 30                	mov    (%eax),%esi
c01091e9:	85 f6                	test   %esi,%esi
c01091eb:	75 05                	jne    c01091f2 <vprintfmt+0x1a8>
                p = "(null)";
c01091ed:	be 59 b0 10 c0       	mov    $0xc010b059,%esi
            }
            if (width > 0 && padc != '-') {
c01091f2:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01091f6:	7e 76                	jle    c010926e <vprintfmt+0x224>
c01091f8:	80 7d db 2d          	cmpb   $0x2d,-0x25(%ebp)
c01091fc:	74 70                	je     c010926e <vprintfmt+0x224>
                for (width -= strnlen(p, precision); width > 0; width --) {
c01091fe:	8b 45 e4             	mov    -0x1c(%ebp),%eax
c0109201:	89 44 24 04          	mov    %eax,0x4(%esp)
c0109205:	89 34 24             	mov    %esi,(%esp)
c0109208:	e8 ba f7 ff ff       	call   c01089c7 <strnlen>
c010920d:	8b 55 e8             	mov    -0x18(%ebp),%edx
c0109210:	29 c2                	sub    %eax,%edx
c0109212:	89 d0                	mov    %edx,%eax
c0109214:	89 45 e8             	mov    %eax,-0x18(%ebp)
c0109217:	eb 16                	jmp    c010922f <vprintfmt+0x1e5>
                    putch(padc, putdat);
c0109219:	0f be 45 db          	movsbl -0x25(%ebp),%eax
c010921d:	8b 55 0c             	mov    0xc(%ebp),%edx
c0109220:	89 54 24 04          	mov    %edx,0x4(%esp)
c0109224:	89 04 24             	mov    %eax,(%esp)
c0109227:	8b 45 08             	mov    0x8(%ebp),%eax
c010922a:	ff d0                	call   *%eax
                for (width -= strnlen(p, precision); width > 0; width --) {
c010922c:	ff 4d e8             	decl   -0x18(%ebp)
c010922f:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c0109233:	7f e4                	jg     c0109219 <vprintfmt+0x1cf>
                }
            }
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c0109235:	eb 37                	jmp    c010926e <vprintfmt+0x224>
                if (altflag && (ch < ' ' || ch > '~')) {
c0109237:	83 7d dc 00          	cmpl   $0x0,-0x24(%ebp)
c010923b:	74 1f                	je     c010925c <vprintfmt+0x212>
c010923d:	83 fb 1f             	cmp    $0x1f,%ebx
c0109240:	7e 05                	jle    c0109247 <vprintfmt+0x1fd>
c0109242:	83 fb 7e             	cmp    $0x7e,%ebx
c0109245:	7e 15                	jle    c010925c <vprintfmt+0x212>
                    putch('?', putdat);
c0109247:	8b 45 0c             	mov    0xc(%ebp),%eax
c010924a:	89 44 24 04          	mov    %eax,0x4(%esp)
c010924e:	c7 04 24 3f 00 00 00 	movl   $0x3f,(%esp)
c0109255:	8b 45 08             	mov    0x8(%ebp),%eax
c0109258:	ff d0                	call   *%eax
c010925a:	eb 0f                	jmp    c010926b <vprintfmt+0x221>
                }
                else {
                    putch(ch, putdat);
c010925c:	8b 45 0c             	mov    0xc(%ebp),%eax
c010925f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0109263:	89 1c 24             	mov    %ebx,(%esp)
c0109266:	8b 45 08             	mov    0x8(%ebp),%eax
c0109269:	ff d0                	call   *%eax
            for (; (ch = *p ++) != '\0' && (precision < 0 || -- precision >= 0); width --) {
c010926b:	ff 4d e8             	decl   -0x18(%ebp)
c010926e:	89 f0                	mov    %esi,%eax
c0109270:	8d 70 01             	lea    0x1(%eax),%esi
c0109273:	0f b6 00             	movzbl (%eax),%eax
c0109276:	0f be d8             	movsbl %al,%ebx
c0109279:	85 db                	test   %ebx,%ebx
c010927b:	74 27                	je     c01092a4 <vprintfmt+0x25a>
c010927d:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c0109281:	78 b4                	js     c0109237 <vprintfmt+0x1ed>
c0109283:	ff 4d e4             	decl   -0x1c(%ebp)
c0109286:	83 7d e4 00          	cmpl   $0x0,-0x1c(%ebp)
c010928a:	79 ab                	jns    c0109237 <vprintfmt+0x1ed>
                }
            }
            for (; width > 0; width --) {
c010928c:	eb 16                	jmp    c01092a4 <vprintfmt+0x25a>
                putch(' ', putdat);
c010928e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0109291:	89 44 24 04          	mov    %eax,0x4(%esp)
c0109295:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
c010929c:	8b 45 08             	mov    0x8(%ebp),%eax
c010929f:	ff d0                	call   *%eax
            for (; width > 0; width --) {
c01092a1:	ff 4d e8             	decl   -0x18(%ebp)
c01092a4:	83 7d e8 00          	cmpl   $0x0,-0x18(%ebp)
c01092a8:	7f e4                	jg     c010928e <vprintfmt+0x244>
            }
            break;
c01092aa:	e9 6c 01 00 00       	jmp    c010941b <vprintfmt+0x3d1>

        // (signed) decimal
        case 'd':
            num = getint(&ap, lflag);
c01092af:	8b 45 e0             	mov    -0x20(%ebp),%eax
c01092b2:	89 44 24 04          	mov    %eax,0x4(%esp)
c01092b6:	8d 45 14             	lea    0x14(%ebp),%eax
c01092b9:	89 04 24             	mov    %eax,(%esp)
c01092bc:	e8 0b fd ff ff       	call   c0108fcc <getint>
c01092c1:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01092c4:	89 55 f4             	mov    %edx,-0xc(%ebp)
            if ((long long)num < 0) {
c01092c7:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01092ca:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01092cd:	85 d2                	test   %edx,%edx
c01092cf:	79 26                	jns    c01092f7 <vprintfmt+0x2ad>
                putch('-', putdat);
c01092d1:	8b 45 0c             	mov    0xc(%ebp),%eax
c01092d4:	89 44 24 04          	mov    %eax,0x4(%esp)
c01092d8:	c7 04 24 2d 00 00 00 	movl   $0x2d,(%esp)
c01092df:	8b 45 08             	mov    0x8(%ebp),%eax
c01092e2:	ff d0                	call   *%eax
                num = -(long long)num;
c01092e4:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01092e7:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01092ea:	f7 d8                	neg    %eax
c01092ec:	83 d2 00             	adc    $0x0,%edx
c01092ef:	f7 da                	neg    %edx
c01092f1:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01092f4:	89 55 f4             	mov    %edx,-0xc(%ebp)
            }
            base = 10;
c01092f7:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
c01092fe:	e9 a8 00 00 00       	jmp    c01093ab <vprintfmt+0x361>

        // unsigned decimal
        case 'u':
            num = getuint(&ap, lflag);
c0109303:	8b 45 e0             	mov    -0x20(%ebp),%eax
c0109306:	89 44 24 04          	mov    %eax,0x4(%esp)
c010930a:	8d 45 14             	lea    0x14(%ebp),%eax
c010930d:	89 04 24             	mov    %eax,(%esp)
c0109310:	e8 64 fc ff ff       	call   c0108f79 <getuint>
c0109315:	89 45 f0             	mov    %eax,-0x10(%ebp)
c0109318:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 10;
c010931b:	c7 45 ec 0a 00 00 00 	movl   $0xa,-0x14(%ebp)
            goto number;
c0109322:	e9 84 00 00 00       	jmp    c01093ab <vprintfmt+0x361>

        // (unsigned) octal
        case 'o':
            num = getuint(&ap, lflag);
c0109327:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010932a:	89 44 24 04          	mov    %eax,0x4(%esp)
c010932e:	8d 45 14             	lea    0x14(%ebp),%eax
c0109331:	89 04 24             	mov    %eax,(%esp)
c0109334:	e8 40 fc ff ff       	call   c0108f79 <getuint>
c0109339:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010933c:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 8;
c010933f:	c7 45 ec 08 00 00 00 	movl   $0x8,-0x14(%ebp)
            goto number;
c0109346:	eb 63                	jmp    c01093ab <vprintfmt+0x361>

        // pointer
        case 'p':
            putch('0', putdat);
c0109348:	8b 45 0c             	mov    0xc(%ebp),%eax
c010934b:	89 44 24 04          	mov    %eax,0x4(%esp)
c010934f:	c7 04 24 30 00 00 00 	movl   $0x30,(%esp)
c0109356:	8b 45 08             	mov    0x8(%ebp),%eax
c0109359:	ff d0                	call   *%eax
            putch('x', putdat);
c010935b:	8b 45 0c             	mov    0xc(%ebp),%eax
c010935e:	89 44 24 04          	mov    %eax,0x4(%esp)
c0109362:	c7 04 24 78 00 00 00 	movl   $0x78,(%esp)
c0109369:	8b 45 08             	mov    0x8(%ebp),%eax
c010936c:	ff d0                	call   *%eax
            num = (unsigned long long)(uintptr_t)va_arg(ap, void *);
c010936e:	8b 45 14             	mov    0x14(%ebp),%eax
c0109371:	8d 50 04             	lea    0x4(%eax),%edx
c0109374:	89 55 14             	mov    %edx,0x14(%ebp)
c0109377:	8b 00                	mov    (%eax),%eax
c0109379:	89 45 f0             	mov    %eax,-0x10(%ebp)
c010937c:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
            base = 16;
c0109383:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
            goto number;
c010938a:	eb 1f                	jmp    c01093ab <vprintfmt+0x361>

        // (unsigned) hexadecimal
        case 'x':
            num = getuint(&ap, lflag);
c010938c:	8b 45 e0             	mov    -0x20(%ebp),%eax
c010938f:	89 44 24 04          	mov    %eax,0x4(%esp)
c0109393:	8d 45 14             	lea    0x14(%ebp),%eax
c0109396:	89 04 24             	mov    %eax,(%esp)
c0109399:	e8 db fb ff ff       	call   c0108f79 <getuint>
c010939e:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01093a1:	89 55 f4             	mov    %edx,-0xc(%ebp)
            base = 16;
c01093a4:	c7 45 ec 10 00 00 00 	movl   $0x10,-0x14(%ebp)
        number:
            printnum(putch, putdat, num, base, width, padc);
c01093ab:	0f be 55 db          	movsbl -0x25(%ebp),%edx
c01093af:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01093b2:	89 54 24 18          	mov    %edx,0x18(%esp)
c01093b6:	8b 55 e8             	mov    -0x18(%ebp),%edx
c01093b9:	89 54 24 14          	mov    %edx,0x14(%esp)
c01093bd:	89 44 24 10          	mov    %eax,0x10(%esp)
c01093c1:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01093c4:	8b 55 f4             	mov    -0xc(%ebp),%edx
c01093c7:	89 44 24 08          	mov    %eax,0x8(%esp)
c01093cb:	89 54 24 0c          	mov    %edx,0xc(%esp)
c01093cf:	8b 45 0c             	mov    0xc(%ebp),%eax
c01093d2:	89 44 24 04          	mov    %eax,0x4(%esp)
c01093d6:	8b 45 08             	mov    0x8(%ebp),%eax
c01093d9:	89 04 24             	mov    %eax,(%esp)
c01093dc:	e8 94 fa ff ff       	call   c0108e75 <printnum>
            break;
c01093e1:	eb 38                	jmp    c010941b <vprintfmt+0x3d1>

        // escaped '%' character
        case '%':
            putch(ch, putdat);
c01093e3:	8b 45 0c             	mov    0xc(%ebp),%eax
c01093e6:	89 44 24 04          	mov    %eax,0x4(%esp)
c01093ea:	89 1c 24             	mov    %ebx,(%esp)
c01093ed:	8b 45 08             	mov    0x8(%ebp),%eax
c01093f0:	ff d0                	call   *%eax
            break;
c01093f2:	eb 27                	jmp    c010941b <vprintfmt+0x3d1>

        // unrecognized escape sequence - just print it literally
        default:
            putch('%', putdat);
c01093f4:	8b 45 0c             	mov    0xc(%ebp),%eax
c01093f7:	89 44 24 04          	mov    %eax,0x4(%esp)
c01093fb:	c7 04 24 25 00 00 00 	movl   $0x25,(%esp)
c0109402:	8b 45 08             	mov    0x8(%ebp),%eax
c0109405:	ff d0                	call   *%eax
            for (fmt --; fmt[-1] != '%'; fmt --)
c0109407:	ff 4d 10             	decl   0x10(%ebp)
c010940a:	eb 03                	jmp    c010940f <vprintfmt+0x3c5>
c010940c:	ff 4d 10             	decl   0x10(%ebp)
c010940f:	8b 45 10             	mov    0x10(%ebp),%eax
c0109412:	48                   	dec    %eax
c0109413:	0f b6 00             	movzbl (%eax),%eax
c0109416:	3c 25                	cmp    $0x25,%al
c0109418:	75 f2                	jne    c010940c <vprintfmt+0x3c2>
                /* do nothing */;
            break;
c010941a:	90                   	nop
    while (1) {
c010941b:	e9 36 fc ff ff       	jmp    c0109056 <vprintfmt+0xc>
                return;
c0109420:	90                   	nop
        }
    }
}
c0109421:	83 c4 40             	add    $0x40,%esp
c0109424:	5b                   	pop    %ebx
c0109425:	5e                   	pop    %esi
c0109426:	5d                   	pop    %ebp
c0109427:	c3                   	ret    

c0109428 <sprintputch>:
 * sprintputch - 'print' a single character in a buffer
 * @ch:         the character will be printed
 * @b:          the buffer to place the character @ch
 * */
static void
sprintputch(int ch, struct sprintbuf *b) {
c0109428:	f3 0f 1e fb          	endbr32 
c010942c:	55                   	push   %ebp
c010942d:	89 e5                	mov    %esp,%ebp
    b->cnt ++;
c010942f:	8b 45 0c             	mov    0xc(%ebp),%eax
c0109432:	8b 40 08             	mov    0x8(%eax),%eax
c0109435:	8d 50 01             	lea    0x1(%eax),%edx
c0109438:	8b 45 0c             	mov    0xc(%ebp),%eax
c010943b:	89 50 08             	mov    %edx,0x8(%eax)
    if (b->buf < b->ebuf) {
c010943e:	8b 45 0c             	mov    0xc(%ebp),%eax
c0109441:	8b 10                	mov    (%eax),%edx
c0109443:	8b 45 0c             	mov    0xc(%ebp),%eax
c0109446:	8b 40 04             	mov    0x4(%eax),%eax
c0109449:	39 c2                	cmp    %eax,%edx
c010944b:	73 12                	jae    c010945f <sprintputch+0x37>
        *b->buf ++ = ch;
c010944d:	8b 45 0c             	mov    0xc(%ebp),%eax
c0109450:	8b 00                	mov    (%eax),%eax
c0109452:	8d 48 01             	lea    0x1(%eax),%ecx
c0109455:	8b 55 0c             	mov    0xc(%ebp),%edx
c0109458:	89 0a                	mov    %ecx,(%edx)
c010945a:	8b 55 08             	mov    0x8(%ebp),%edx
c010945d:	88 10                	mov    %dl,(%eax)
    }
}
c010945f:	90                   	nop
c0109460:	5d                   	pop    %ebp
c0109461:	c3                   	ret    

c0109462 <snprintf>:
 * @str:        the buffer to place the result into
 * @size:       the size of buffer, including the trailing null space
 * @fmt:        the format string to use
 * */
int
snprintf(char *str, size_t size, const char *fmt, ...) {
c0109462:	f3 0f 1e fb          	endbr32 
c0109466:	55                   	push   %ebp
c0109467:	89 e5                	mov    %esp,%ebp
c0109469:	83 ec 28             	sub    $0x28,%esp
    va_list ap;
    int cnt;
    va_start(ap, fmt);
c010946c:	8d 45 14             	lea    0x14(%ebp),%eax
c010946f:	89 45 f0             	mov    %eax,-0x10(%ebp)
    cnt = vsnprintf(str, size, fmt, ap);
c0109472:	8b 45 f0             	mov    -0x10(%ebp),%eax
c0109475:	89 44 24 0c          	mov    %eax,0xc(%esp)
c0109479:	8b 45 10             	mov    0x10(%ebp),%eax
c010947c:	89 44 24 08          	mov    %eax,0x8(%esp)
c0109480:	8b 45 0c             	mov    0xc(%ebp),%eax
c0109483:	89 44 24 04          	mov    %eax,0x4(%esp)
c0109487:	8b 45 08             	mov    0x8(%ebp),%eax
c010948a:	89 04 24             	mov    %eax,(%esp)
c010948d:	e8 08 00 00 00       	call   c010949a <vsnprintf>
c0109492:	89 45 f4             	mov    %eax,-0xc(%ebp)
    va_end(ap);
    return cnt;
c0109495:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0109498:	c9                   	leave  
c0109499:	c3                   	ret    

c010949a <vsnprintf>:
 *
 * Call this function if you are already dealing with a va_list.
 * Or you probably want snprintf() instead.
 * */
int
vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {
c010949a:	f3 0f 1e fb          	endbr32 
c010949e:	55                   	push   %ebp
c010949f:	89 e5                	mov    %esp,%ebp
c01094a1:	83 ec 28             	sub    $0x28,%esp
    struct sprintbuf b = {str, str + size - 1, 0};
c01094a4:	8b 45 08             	mov    0x8(%ebp),%eax
c01094a7:	89 45 ec             	mov    %eax,-0x14(%ebp)
c01094aa:	8b 45 0c             	mov    0xc(%ebp),%eax
c01094ad:	8d 50 ff             	lea    -0x1(%eax),%edx
c01094b0:	8b 45 08             	mov    0x8(%ebp),%eax
c01094b3:	01 d0                	add    %edx,%eax
c01094b5:	89 45 f0             	mov    %eax,-0x10(%ebp)
c01094b8:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
    if (str == NULL || b.buf > b.ebuf) {
c01094bf:	83 7d 08 00          	cmpl   $0x0,0x8(%ebp)
c01094c3:	74 0a                	je     c01094cf <vsnprintf+0x35>
c01094c5:	8b 55 ec             	mov    -0x14(%ebp),%edx
c01094c8:	8b 45 f0             	mov    -0x10(%ebp),%eax
c01094cb:	39 c2                	cmp    %eax,%edx
c01094cd:	76 07                	jbe    c01094d6 <vsnprintf+0x3c>
        return -E_INVAL;
c01094cf:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
c01094d4:	eb 2a                	jmp    c0109500 <vsnprintf+0x66>
    }
    // print the string to the buffer
    vprintfmt((void*)sprintputch, &b, fmt, ap);
c01094d6:	8b 45 14             	mov    0x14(%ebp),%eax
c01094d9:	89 44 24 0c          	mov    %eax,0xc(%esp)
c01094dd:	8b 45 10             	mov    0x10(%ebp),%eax
c01094e0:	89 44 24 08          	mov    %eax,0x8(%esp)
c01094e4:	8d 45 ec             	lea    -0x14(%ebp),%eax
c01094e7:	89 44 24 04          	mov    %eax,0x4(%esp)
c01094eb:	c7 04 24 28 94 10 c0 	movl   $0xc0109428,(%esp)
c01094f2:	e8 53 fb ff ff       	call   c010904a <vprintfmt>
    // null terminate the buffer
    *b.buf = '\0';
c01094f7:	8b 45 ec             	mov    -0x14(%ebp),%eax
c01094fa:	c6 00 00             	movb   $0x0,(%eax)
    return b.cnt;
c01094fd:	8b 45 f4             	mov    -0xc(%ebp),%eax
}
c0109500:	c9                   	leave  
c0109501:	c3                   	ret    
